develooper Front page | perl.beginners | Postings from June 2007

Re: Passing arguments to subroutine

Thread Previous | Thread Next
From:
Paul Lalli
Date:
June 1, 2007 06:14
Subject:
Re: Passing arguments to subroutine
Message ID:
1180701915.312301.132520@q75g2000hsh.googlegroups.com
On May 31, 9:35 am, eish...@googlemail.com (Eish...@Googlemail.Com)
wrote:
> On May 31, 9:27 am, almatir...@gmail.com (Alma) wrote:
>
> > # extract the file name
> > #       my @parts = split('\/',$file_path);

> Your split statement seems to be wrong. split uses a regex to match so
> it should be:
>
> split /\\/, $file_path;

There is nothing at all wrong with the OP's split.  Single quotes are
a perfectly legitamite delimiter for a regular expression.  And why
did you change the OP's from splitting on a front-slash to splitting
on a back-slash?

Paul Lalli


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About