[Sderby] PERL

Kevin Noon sderby at mailman.lug.org.uk
Mon Dec 30 13:18:00 2002


Hi,
I hope this info is of use to you
I was the in cheap book shop in Ashby they have a few books on Pearl at
a very good price.
Regards Kevin
-----Original Message-----
From: sderby-admin@mailman.lug.org.uk
[mailto:sderby-admin@mailman.lug.org.uk] On Behalf Of
andre.hefer@avhservices.co.uk
Sent: 29 December 2002 18:16
To: sderby@mailman.lug.org.uk
Subject: Re: [Sderby] PERL

Dave

If you look in the Perl Cookbook on http://safari.oreilly.com/ you will
find
a lot of useful info. I am a member and pay US $10 per month for access
to
five books.

Here is the hyperlink to the recipe you are looking for.

http://safari.oreilly.com/?XmlId=1-56592-243-3/ch09-24-fm2xml


Andre
----- Original Message -----
From: "David Jolley" <dave@lucien.cx>
To: <sderby@mailman.lug.org.uk>
Sent: Friday, December 27, 2002 2:25 PM
Subject: Re: [Sderby] PERL


> * hemstock@tiscali.co.uk (hemstock@tiscali.co.uk) wrote:
> > All,
> >
> > Does anyone know anything about PERL?  I'm trying to capture the
listing
> > of a directory and then assign each file name to a variable for
testing.
> >  I've got as far as
> >
> > $line=`ls`
> >
> > Now I want to set up a loop to assign the first file to a variable,
test
> > it, then the second, then third, etc.
> >
> What do you then need to do to the filenames in the variables - it may
> be the case that what you actually need to achieve is best achieved in
> sh script, and judicious use of xargs.
>
> Failing that, to assign all the filenames to a list use:
>
> $a = (`ls`);
>
> Then;
>
> print "$a";
>
> will print them all out to confirm it worked.  Or, more accurately, it
> worked for me :)
>
> You should then be able to use the perl list iteration constructs to
> go through each element in turn.
>
> > Sorry if this isn't too clear, I can't find a clear way to explain
it!
> >
> Hopefully this is what you wanted...
>
> Cheers,
>
> Dave.
>
> --
> Lord of the Rings (abridged):
>         Some guys take a long holiday to throw a ring in a volcano.
>
> _______________________________________________
> Sderby mailing list
> Sderby@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/sderby
> Web site: http://sderby.lug.org.uk/
> wiki: http://www.sderby.lug.org.uk/cgi-bin/wiki.pl
>


_______________________________________________
Sderby mailing list
Sderby@mailman.lug.org.uk
http://mailman.lug.org.uk/mailman/listinfo/sderby
Web site: http://sderby.lug.org.uk/
wiki: http://www.sderby.lug.org.uk/cgi-bin/wiki.pl