On Thu, 11 Aug 2011 16:17:51 -0700, wrote:
> This works! Is there a way to do it with less typing? How can I do it
> without creating a temporary variable "@p"?
rename($_, sprintf("./%s.txt", (split '/')[-1]));
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands,
On Thu, 30 Dec 2010 18:30:04 -0800, Parag Kalra wrote:
> Hi,
>
> Just like $0 reveals the current script name is there any variable
> using which I can find the current sub-routine I am currently in.
printf("currently in %s\n", (caller(0))[3] =~ /^.+:(\w+)$/);
See `perldoc -f caller'.
-
"raphael()" wrote on Fri, 18 Sep 2009
22:10:01 +0530:
>Hi
>
>How do I pick out matching words if there are more than one on the same
>line?
>
>
>Example
>
>INFILE.TXT
>
>www.site01.com www.site02.com www.site03.com
>www.site04.com
>
>--
>
>while (<>) {
>if ( m!(www.\S+.com)!s ) {
Try m!(
Noah Garrett Wallach wrote on Thu, 17 Sep 2009
13:23:37 -0700
>Hi there Perl folks,
>
>
>Okay I am trying to figure this out.
>
>I am trying to match the following:
>
>
>$line = "blah&blah&blah"
>
>
>so I have the following line to match that
>
>$line =~ /((?:blah).*?){0,5}/;
>But I want to captu