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 man pages.
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 the modules
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 -
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:
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
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 Info:
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
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 know :)
--
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:
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
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
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
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 afternoon
13 matches
Mail list logo