[plug] A question for perl hackers

Grahame Bowland grahame at azale.net
Tue Aug 27 22:22:48 WST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 21 Aug 2002 11:18 pm, Leon Brooks wrote:
> On Wed, 21 Aug 2002 23:00, Lyndon Kroker wrote:
> > I am trying to grab the filesize in bytes from a listing like:
> >
> >    310272 Aug 21 22:18 inbox
> >   5193576 Jul  7 09:45 lyndon
> >         0 Aug 12 09:58 mailing lists
> >     32720 Jun 10 20:10 mchoice
> >     46513 Aug 16 16:18 netvigator
> >         0 Aug 21 20:04 outbox
> >  10069208 Aug 21 20:04 sent-mail
> >   2377093 Aug 21 19:33 trash
>
> Pity you can't use (g)awk, 'coz that becomes:
>
>     variable = $1
>
> Huge. I'd be surprised - nay, mortified - if there wasn't a similarly
> simple way of doing that in PERL.

Oh well, my chosen language takes a few more lines:

for i in sys.stdin.xreadlines():
  size = int(i.split()[0])
  ..

- -- 
Grahame Bowland - <grahame at azale.net>
'All programmers are playwrights and all computers are lousy actors'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9a4s6N7eIygKWKbARApDLAJ9bOd4wydf5nbR8fdGsNcLopz1QsQCgjpG8
cwDVG9iiOCJxrXbIFQoNhB8=
=d/NG
-----END PGP SIGNATURE-----




More information about the plug mailing list