CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Meaning of the below syntax

 



peacepanda3
New User

Jan 21, 2014, 12:19 AM

Post #1 of 3 (1343 views)
Meaning of the below syntax Can't Post

Hi,

Can anyone tell me what do the following lines of code mean



$line =~ s/^[ \t]+//;
$line =~ s/[ \t]+$//;



Regards,

Ajit


BillKSmith
Veteran

Jan 21, 2014, 5:28 AM

Post #2 of 3 (1338 views)
Re: [peacepanda3] Meaning of the below syntax [In reply to] Can't Post

This code removes one or more TAB characters from the beginning and end of the string contained in the variable $line.
Good Luck,
Bill


Laurent_R
Veteran / Moderator

Jan 21, 2014, 10:58 AM

Post #3 of 3 (1323 views)
Re: [BillKSmith] Meaning of the below syntax [In reply to] Can't Post


In Reply To
This code removes one or more TAB characters from the beginning and end of the string contained in the variable $line.


Actually one or more TAB or SPACE characters from the beginning and end of the string contained in the variable $line, since the character class contains a space and a tab (hard to see the space because of the lack of code markup in the original post, but it is there).

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives