Re: [SLUG] perl quicky

2002-01-30 Thread John Clarke
On Tue, Jan 29, 2002 at 08:14:36AM +1100, Grant Parnell wrote: > I noticed James answered but generally speaking I frequently use "man > perlfunc" as a quick reference guide. "man perl" gives you the index of > the man pages. Other ones I tend to use are "man perlre" and "man perlop". > For th

Re: [SLUG] perl quicky

2002-01-30 Thread Grant Parnell
On Sat, 26 Jan 2002, > Dean Hamstead < wrote: > does perl have a function to return the length of a string? > > eg > > $length = size($foo); > I noticed James answered but generally speaking I frequently use "man perlfunc" as a quick reference guide. "man perl" gives you the index of the ma

Re: [SLUG] perl quicky

2002-01-25 Thread James Morris
On Sat, 26 Jan 2002, > Dean Hamstead < wrote: > does perl have a function to return the length of a string? > > eg > > $length = size($foo); > length() - James -- James Morris <[EMAIL PROTECTED]> -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists

[SLUG] perl quicky

2002-01-25 Thread > Dean Hamstead
does perl have a function to return the length of a string? eg $length = size($foo); Dean -- -- -- ME: http://dean.bong.com.auICQ: 16867613 [EMAIL PROTECTED][EMAIL PROTECTED] -- SLUG - Sydney Linux User Group Mailing List - http:/

Re: [SLUG] Perl Quicky

2000-11-06 Thread Ken Yap
>I would like to strip special characters >eg. anything not A..Z a..z 0..9 >From what? A string, a line, a whole file? Anyway have a look at the translit operator (y or tr) under man perlop, with the c and d options. -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Inf

[SLUG] Perl Quicky

2000-11-06 Thread Dean Hamstead
I would like to strip special characters eg. anything not A..Z a..z 0..9 Dean -- BONG: http://www.bong.com.au EMAIL... [EMAIL PROTECTED][EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] ICQ: 16867613 -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More In

Re: [SLUG] perl quicky

2000-10-15 Thread Matthew Dalton
Herbert Xu wrote: > > There is a /proc/self you know :) Okay, well I didn't see that there... but that wouldn't have been any fun anyway! -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug

Re: [SLUG] perl quicky

2000-10-13 Thread Herbert Xu
Matthew Dalton <[EMAIL PROTECTED]> wrote: > > Friday afternoon blues > #!/usr/bin/perl > # only works on Linux :) > $pid = `ps | grep $0 | grep perl | grep -v grep | cut -d " " -f 1`; > chomp($pid); > print `ls /proc/$pid -l | grep cwd | sed -e 's/.*cwd -> //g'`; There is a /proc/self you k

Re: [SLUG] perl quicky

2000-10-12 Thread Matthew Dalton
Rodos wrote: > > On Fri, 13 Oct 2000, Dean Hamstead wrote: > > > how do i get the name of current directory (basically pwd) in perl? > > chop($cwd = `pwd`); > > or > > perl -e 'use Cwd; print "You are in the " . cwd . " directory\n";' > You are in the /home/rodos directory > > Easy. Friday

Re: [SLUG] perl quicky

2000-10-12 Thread Rodos
On Fri, 13 Oct 2000, Dean Hamstead wrote: > how do i get the name of current directory (basically pwd) in perl? chop($cwd = `pwd`); or perl -e 'use Cwd; print "You are in the " . cwd . " directory\n";' You are in the /home/rodos directory Easy. Rodos -- SLUG - Sydney Linux User Group Mail

Re: [SLUG] perl quicky

2000-10-12 Thread Stuart Cooper
how do i get the name of current directory (basically pwd) in perl? use Cwd; $dir = getcwd; this is in my opinion better than $dir=`pwd`; chomp $dir; kind of solutions. perldoc Cwd for the whole story. Stuart. -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Inf

Re: [SLUG] perl quicky

2000-10-12 Thread John Clarke
On Fri, Oct 13, 2000 at 02:42:12PM +1100, Dean Hamstead wrote: > how do i get the name of current directory (basically pwd) in perl? [johnc@dropbear ~]$ perl -e 'print `pwd`' /home/johnc -- whois [EMAIL PROTECTED] -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info

[SLUG] perl quicky

2000-10-12 Thread Dean Hamstead
how do i get the name of current directory (basically pwd) in perl? Dean -- BONG: http://www.bong.com.au EMAIL... [EMAIL PROTECTED][EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] ICQ: 16867613 -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: h