Perly Perly

Nov 07, 2004 21:48

[ Context: Programming ]

Wrote a Perl script after a while. Whoops! Had to look up perldoc and google to quickly gather examples of different things I was trying to do. Didn't take much time apart from that taken up by lookup itself.

The code in the script looks like this right now:

} elsif ($ln=~m/^!\s+(#\S+)\s+\d+\s+(\w+)/) {
Now, it needs to ( Read more... )

Leave a comment

Comments 3

bluesmoon November 8 2004, 00:26:14 UTC
The beauty of perl is that there are so many idioms, that almost all code can be written with only idioms, making it easy to understand without comments. Problem is that most perl programmers haven't been around long enough to know the idioms.

btw, m is optional if you use // as delimiters. So you're trying to match something like:

! #afasfaj 235948 jlajga3094gvjaAAAAA_Ags

and capture the #afasfaj and jlajga3094gvjaAAAA_Ags into $1 and $2

whatever for?

Reply

manish November 8 2004, 17:17:18 UTC
The beauty of perl is that there are so many idioms, that almost all code can be written with only idioms, making it easy to understand without comments. Problem is that most perl programmers haven't been around long enough to know the idioms.

*nod*
Places like perlmonks do help in this regard, and I am getting back to the community.

btw, m is optional if you use // as delimiters.

ah, thanks. :)

Reply

manish November 8 2004, 17:20:13 UTC
So you're trying to match something like:

! #afasfaj 235948 jlajga3094gvjaAAAAA_Ags

and capture the #afasfaj and jlajga3094gvjaAAAA_Ags into $1 and $2

yes. :)
#afasfaj would be an IRC channel name. That's a line syntax from an eggdrop user file.

Reply


Leave a comment

Up