Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl equivalent to substr()?

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
I know that Perl has some pattern matching abilities, but does it have something that is the equivalent to the php substr(string, startpoint, count) function? I'm working with a perl program, and it would be useful if I could not only check that files match a general pattern (program already does so), but specifically strip a specific portion of that pattern out and use it in the program as a variable value.

The text I've been working with doesn't mention this kind of capability; I'm not sure where I would begin looking for this. If someone would please provide me with a good starting point, I would be grateful.
 
perl has indeed a function like that and it is the following
Code:
substr(string, startpoint, count)
no joking...it is the same as the one in php...:)


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
is your friend :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top