[30100] in Perl-Users-Digest
Perl-Users Digest, Issue: 1343 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 8 09:09:43 2008
Date: Sat, 8 Mar 2008 06:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 8 Mar 2008 Volume: 11 Number: 1343
Today's topics:
Re: FAQ 5.3 How do I count the number of lines in a fil sheinrich@my-deja.com
Re: FAQ 5.3 How do I count the number of lines in a fil <ben@morrow.me.uk>
how to read user's IP adress with Perl? <marthan@csv.t-portal.cc>
Re: how to read user's IP adress with Perl? <devnull4711@web.de>
Net::SMTP - "Bad File Number" error ? <wheeledBobNOSPAM@yahoo.com>
Re: Net::SMTP - "Bad File Number" error ? <devnull4711@web.de>
new CPAN modules on Sat Mar 8 2008 (Randal Schwartz)
OK I want read: IP Address properties of user's Interne <marthan@csv.t-portal.cc>
Re: OK I want read: IP Address properties of user's Int <devnull4711@web.de>
Re: OK I want read: IP Address properties of user's Int <devnull4711@web.de>
Re: OK I want read: IP Address properties of user's Int <noreply@gunnar.cc>
Perl pattern extraction (SE)
Re: Perl pattern extraction <ben@morrow.me.uk>
Re: Perl pattern extraction <noreply@gunnar.cc>
Perl pattern matching and extraction (SE)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 8 Mar 2008 04:46:34 -0800 (PST)
From: sheinrich@my-deja.com
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <3f1390c7-e865-46f0-b6f3-9f9c708fdb09@n77g2000hse.googlegroups.com>
On Mar 6, 3:03 am, PerlFAQ Server <br...@stonehenge.com> wrote:
>
> --------------------------------------------------------------------
>
> 5.3: How do I count the number of lines in a file?
>
> One fairly efficient way is to count newlines in the file. The following
> program uses a feature of tr///, as documented in perlop. If your text
> file doesn't end with a newline, then it's not really a proper text
> file, so this may report one fewer line than you expect.
>
> $lines = 0;
> open(FILE, $filename) or die "Can't open `$filename': $!";
> while (sysread FILE, $buffer, 4096) {
> $lines += ($buffer =~ tr/\n//);
> }
> close FILE;
>
> This assumes no funny games with newline translations.
>
> --------------------------------------------------------------------
>
Doesn't it maybe make a difference (regarding performance) whether I'm
writing
$lines += ($buffer =~ tr/\n/\n/);
?
More often than never I find myself musing if a substitution with a
replacement of same size could be more performant than others. I think
that this might prevent costly block-shiftings on large data.
Also, tr/// (and s///) might be possibly optimized by shifting to a
'count-mode' if it is detected that the pattern and the replacement
both are hardcoded and are the same.
Insights?
steffen
------------------------------
Date: Sat, 8 Mar 2008 13:54:40 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <0eiaa5-av2.ln1@osiris.mauzo.dyndns.org>
Quoth sheinrich@my-deja.com:
> On Mar 6, 3:03 am, PerlFAQ Server <br...@stonehenge.com> wrote:
> >
> > --------------------------------------------------------------------
> >
> > 5.3: How do I count the number of lines in a file?
> >
> > One fairly efficient way is to count newlines in the file. The following
> > program uses a feature of tr///, as documented in perlop. If your text
> > file doesn't end with a newline, then it's not really a proper text
> > file, so this may report one fewer line than you expect.
> >
> > $lines = 0;
> > open(FILE, $filename) or die "Can't open `$filename': $!";
> > while (sysread FILE, $buffer, 4096) {
> > $lines += ($buffer =~ tr/\n//);
> > }
> > close FILE;
> >
> > This assumes no funny games with newline translations.
> >
> > --------------------------------------------------------------------
> >
> Doesn't it maybe make a difference (regarding performance) whether I'm
> writing
> $lines += ($buffer =~ tr/\n/\n/);
> ?
Nope. That does exactly the same thing.
> More often than never I find myself musing if a substitution with a
> replacement of same size could be more performant than others. I think
> that this might prevent costly block-shiftings on large data.
>
> Also, tr/// (and s///) might be possibly optimized by shifting to a
> 'count-mode' if it is detected that the pattern and the replacement
> both are hardcoded and are the same.
tr/// with empty replacement and without /d and m// in scalar context
(with no capturing parens) are the operators you are looking for. Both
just count, and don't replace anything.
Ben
------------------------------
Date: Sat, 8 Mar 2008 09:51:30 +0100
From: "Marthan" <marthan@csv.t-portal.cc>
Subject: how to read user's IP adress with Perl?
Message-Id: <fqtk2h$5ko$1@ss408.t-com.hr>
how to read user's IP adress with Perl?
Marhan
------------------------------
Date: Sat, 08 Mar 2008 10:00:13 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: how to read user's IP adress with Perl?
Message-Id: <63f2svF272j4tU2@mid.individual.net>
Marthan wrote:
> how to read user's IP adress with Perl?
Hm, for me, a network interface has an ip address, not a user.
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Sat, 08 Mar 2008 07:49:16 GMT
From: still just me <wheeledBobNOSPAM@yahoo.com>
Subject: Net::SMTP - "Bad File Number" error ?
Message-Id: <upg4t3hpnf676oss8lvutki3gudnlcl988@4ax.com>
I'm using Net::SMTP to send mail from a perl program running on a web
server. Code is as follows:
my $relay="smtp.example.com";
my $smtp = Net::SMTP->new($relay);
die "Could not open connection: $!" if (! defined $smtp);
I'm familiar with the error you get when the SMTP server won't let you
in. It's usually "Could not open connection: Connection refused at
line... ". I run into that from time to time and the server people fix
what they messed up.
On this particular server (which used to work, but apparently they've
made changes), I'm now getting this error:
"Could not open connection:Bad file number at
/public_html/cgi-bin/submit.pl line 101"
What does "bad file number" mean?
Thanks,
------------------------------
Date: Sat, 08 Mar 2008 09:33:40 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Net::SMTP - "Bad File Number" error ?
Message-Id: <63f1b6F272j4tU1@mid.individual.net>
still just me wrote:
> I'm using Net::SMTP to send mail from a perl program running on a web
> server. Code is as follows:
>
> my $relay="smtp.example.com";
> my $smtp = Net::SMTP->new($relay);
> die "Could not open connection: $!" if (! defined $smtp);
I think $! is not meaningful here. See "perldoc perlvar"
for the definition of $!.
> What does "bad file number" mean?
It means, that a file handle was used that was not open.
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Sat, 8 Mar 2008 05:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Mar 8 2008
Message-Id: <JxED6H.MJu@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
App-Booklist-0.3_01
http://search.cpan.org/~genehack/App-Booklist-0.3_01/
Track books you want to read, are reading, and have read
----
Bundle-CMap-1.0.1
http://search.cpan.org/~bfaga/Bundle-CMap-1.0.1/
Bundle of CMap requirements
----
CGI-Upload-1.11
http://search.cpan.org/~szabgab/CGI-Upload-1.11/
CGI class for handling browser file uploads
----
CPAN-Mini-0.568
http://search.cpan.org/~rjbs/CPAN-Mini-0.568/
create a minimal mirror of CPAN
----
CPAN-Porters-0.02
http://search.cpan.org/~szabgab/CPAN-Porters-0.02/
resource for people maintaining packages of CPAN modules in various distributions
----
Catalyst-Model-NetBlogger-0.04001
http://search.cpan.org/~claco/Catalyst-Model-NetBlogger-0.04001/
Catalyst Model to post and retrieve blog entries using Net::Blogger
----
Class-Data-Accessor-0.04002
http://search.cpan.org/~claco/Class-Data-Accessor-0.04002/
Inheritable, overridable class and instance data accessor creation
----
Convert-Scalar-1.04
http://search.cpan.org/~mlehmann/Convert-Scalar-1.04/
convert between different representations of perl scalars
----
DBIx-Class-InflateColumn-Currency-0.02002
http://search.cpan.org/~claco/DBIx-Class-InflateColumn-Currency-0.02002/
Auto-create Data::Currency objects from columns.
----
DBIx-Class-UUIDColumns-0.02003
http://search.cpan.org/~claco/DBIx-Class-UUIDColumns-0.02003/
Implicit uuid columns
----
DBIx-Class-Validation-0.02002
http://search.cpan.org/~claco/DBIx-Class-Validation-0.02002/
Validate all data before submitting to your database.
----
DBIx-MoCo-0.17
http://search.cpan.org/~jkondo/DBIx-MoCo-0.17/
Light & Fast Model Component
----
DBIx-ORM-Declarative-0.22
http://search.cpan.org/~jschneid/DBIx-ORM-Declarative-0.22/
Perl extension for object-oriented database access
----
Data-GUID-URLSafe-0.003
http://search.cpan.org/~rjbs/Data-GUID-URLSafe-0.003/
url-safe base64-encoded GUIDs
----
Data-ResultSet-1.000
http://search.cpan.org/~doneill/Data-ResultSet-1.000/
Container for aggregating and examining multiple results
----
Date-Span-1.124
http://search.cpan.org/~rjbs/Date-Span-1.124/
deal with date/time ranges than span multiple dates
----
DateTime-Format-ICal-0.09
http://search.cpan.org/~drolsky/DateTime-Format-ICal-0.09/
Parse and format iCal datetime and duration strings
----
Devel-NYTProf-0.05
http://search.cpan.org/~akaplan/Devel-NYTProf-0.05/
line-by-line code profiler and report generator
----
Egg-Plugin-Cache-UA-1.00
http://search.cpan.org/~lushe/Egg-Plugin-Cache-UA-1.00/
The result of the WEB request is cached.
----
ExtUtils-Install-1.50
http://search.cpan.org/~yves/ExtUtils-Install-1.50/
install files from here to there
----
Finance-Currency-Convert-1.06
http://search.cpan.org/~janw/Finance-Currency-Convert-1.06/
Convert currencies and fetch their exchange rates (with Finance::Quote)
----
MIME-EncWords-1.000
http://search.cpan.org/~nezumi/MIME-EncWords-1.000/
deal with RFC 2047 encoded words (improved)
----
Makefile-DOM-0.001
http://search.cpan.org/~agent/Makefile-DOM-0.001/
Simple DOM parser for Makefiles
----
Makefile-DOM-0.002
http://search.cpan.org/~agent/Makefile-DOM-0.002/
Simple DOM parser for Makefiles
----
Makefile-Parser-0.20
http://search.cpan.org/~agent/Makefile-Parser-0.20/
A simple parser for Makefiles
----
Module-Install-AuthorTests-0.002
http://search.cpan.org/~rjbs/Module-Install-AuthorTests-0.002/
designate tests only run by module authors
----
MooseX-Params-Validate-0.05
http://search.cpan.org/~drolsky/MooseX-Params-Validate-0.05/
an extension of Params::Validate for using Moose's types
----
MooseX-Singleton-0.07
http://search.cpan.org/~sartak/MooseX-Singleton-0.07/
turn your Moose class into a singleton
----
Net-LDAP-Extension-eDirectoryPassword-0.00_01
http://search.cpan.org/~ghalse/Net-LDAP-Extension-eDirectoryPassword-0.00_01/
LDAPv3 extension object to retrieve eDirectory Universal Password
----
Net-OAuth-0.06
http://search.cpan.org/~kgrennan/Net-OAuth-0.06/
----
POE-Component-AI-MegaHAL-1.10
http://search.cpan.org/~bingos/POE-Component-AI-MegaHAL-1.10/
A non-blocking wrapper around AI::MegaHAL.
----
POE-Component-Client-DNSBL-0.06
http://search.cpan.org/~bingos/POE-Component-Client-DNSBL-0.06/
A component that provides non-blocking DNSBL lookups
----
POE-Component-Client-NNTP-2.06
http://search.cpan.org/~bingos/POE-Component-Client-NNTP-2.06/
A POE component that implements an RFC 977 NNTP client.
----
POE-Component-IRC-Plugin-Google-Calculator-0.03
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-Google-Calculator-0.03/
non-blocking access to Google's calculator via IRC
----
POE-Component-IRC-Plugin-WWW-XKCD-AsText-0.001
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-WWW-XKCD-AsText-0.001/
read http://xkcd.com comics on IRC
----
POE-Component-WWW-PastebinCa-Retrieve-0.002
http://search.cpan.org/~zoffix/POE-Component-WWW-PastebinCa-Retrieve-0.002/
non-blocking wrapper around WWW::PastebinCa::Retrieve
----
POE-Component-WWW-PastebinCa-Retrieve-0.003
http://search.cpan.org/~zoffix/POE-Component-WWW-PastebinCa-Retrieve-0.003/
non-blocking wrapper around WWW::PastebinCa::Retrieve
----
POE-Component-WWW-PastebinCom-Retrieve-0.002
http://search.cpan.org/~zoffix/POE-Component-WWW-PastebinCom-Retrieve-0.002/
non-blocking wrapper around WWW::PastebinCom::Retrieve
----
POE-Component-WWW-XKCD-AsText-0.001
http://search.cpan.org/~zoffix/POE-Component-WWW-XKCD-AsText-0.001/
non-blocking wrapper around WWW::XKCD::AsText
----
POE-Filter-Bzip2-1.56
http://search.cpan.org/~bingos/POE-Filter-Bzip2-1.56/
A POE filter wrapped around Compress::Bzip2
----
POE-Filter-CSV-1.12
http://search.cpan.org/~bingos/POE-Filter-CSV-1.12/
A POE-based parser for CSV based files.
----
POE-Filter-CSV_XS-1.10
http://search.cpan.org/~bingos/POE-Filter-CSV_XS-1.10/
A POE-based parser for CSV based files.
----
POE-Filter-IASLog-1.02
http://search.cpan.org/~bingos/POE-Filter-IASLog-1.02/
A POE Filter for Microsoft IAS-formatted log entries.
----
POE-Filter-IRCD-2.36
http://search.cpan.org/~bingos/POE-Filter-IRCD-2.36/
A POE-based parser for the IRC protocol.
----
POE-Filter-LOLCAT-1.02
http://search.cpan.org/~bingos/POE-Filter-LOLCAT-1.02/
POE FILTR T SPEKK LIEK LOLCATZ. KTHNX!
----
POE-Filter-LZF-1.66
http://search.cpan.org/~bingos/POE-Filter-LZF-1.66/
A POE filter wrapped around Compress::LZF
----
POE-Filter-LZO-1.66
http://search.cpan.org/~bingos/POE-Filter-LZO-1.66/
A POE filter wrapped around Compress::LZO
----
POE-Filter-LZW-1.66
http://search.cpan.org/~bingos/POE-Filter-LZW-1.66/
A POE filter wrapped around Compress::LZW
----
POE-Filter-ParseWords-1.02
http://search.cpan.org/~bingos/POE-Filter-ParseWords-1.02/
A POE-based parser to parse text into an array of tokens.
----
POE-Filter-Zlib-1.94
http://search.cpan.org/~bingos/POE-Filter-Zlib-1.94/
A POE filter wrapped around Compress::Zlib
----
RDF-Query-2.000_03
http://search.cpan.org/~gwilliams/RDF-Query-2.000_03/
An RDF query implementation of SPARQL/RDQL in Perl for use with RDF::Redland and RDF::Core.
----
RDF-Trine-0.102
http://search.cpan.org/~gwilliams/RDF-Trine-0.102/
An RDF Framework for Perl.
----
Regexp-Common-IRC-0.04
http://search.cpan.org/~perigrin/Regexp-Common-IRC-0.04/
provide patterns for parsing IRC messages
----
Samba-LDAP-0.05
http://search.cpan.org/~ghenry/Samba-LDAP-0.05/
Manage a Samba PDC with an LDAP Backend
----
Slackware-Slackget-0.16
http://search.cpan.org/~dupuisarn/Slackware-Slackget-0.16/
The main slack-get 1.0 library
----
Test-Server-0.02
http://search.cpan.org/~jkutej/Test-Server-0.02/
what about test driven administration?
----
Tk-ACH-0.04
http://search.cpan.org/~yewenbin/Tk-ACH-0.04/
----
Verilog-Readmem-0.02
http://search.cpan.org/~gsullivan/Verilog-Readmem-0.02/
Parse Verilog $readmemh or $readmemb text file
----
WWW-XKCD-AsText-0.001
http://search.cpan.org/~zoffix/WWW-XKCD-AsText-0.001/
retrieve text versions of comics on www.xkcd.com
----
kephra-0.3.6_10
http://search.cpan.org/~lichtkind/kephra-0.3.6_10/
----
sys-0.2
http://search.cpan.org/~asksh/sys-0.2/
Information about the currently running Perl interpreter.
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sat, 8 Mar 2008 10:23:48 +0100
From: "Marthan" <marthan@csv.t-portal.cc>
Subject: OK I want read: IP Address properties of user's Internet Connection
Message-Id: <fqtlv3$9nh$1@ss408.t-com.hr>
OK I want read: IP Address properties of user's Internet Connection
"Frank Seitz" <devnull4711@web.de> wrote in message
news:63f2svF272j4tU2@mid.individual.net...
> Marthan wrote:
> > how to read user's IP adress with Perl?
>
> Hm, for me, a network interface has an ip address, not a user.
>
> Frank
> --
> Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
> Anwendungen für Ihr Internet und Intranet
> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Sat, 08 Mar 2008 10:36:15 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: OK I want read: IP Address properties of user's Internet Connection
Message-Id: <63f50hF272j4tU4@mid.individual.net>
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection
http://kuerzer.de/cookbook_receipe17.7
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Sat, 08 Mar 2008 10:45:14 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: OK I want read: IP Address properties of user's Internet Connection
Message-Id: <63f5hcF27cqh3U2@mid.individual.net>
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection
Google: "identifying the other end of a socket"
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Sat, 08 Mar 2008 11:17:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: OK I want read: IP Address properties of user's Internet Connection
Message-Id: <63f7j1F27hgtoU1@mid.individual.net>
Marthan wrote:
> OK I want read: IP Address properties of user's Internet Connection
If you by "read" mean "find out what it is", and assuming you run a CGI
script, you may be looking for the environment variable $ENV{REMOTE_ADDR}.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 8 Mar 2008 04:09:03 -0800 (PST)
From: "Deepan - M.Sc(SE) - 03MW06" <deepan.17@gmail.com>
Subject: Perl pattern extraction
Message-Id: <1ef21893-934c-46c9-ab54-fb19c0262396@i29g2000prf.googlegroups.com>
Hi,
my $url = "/pages-cell.net/deepan/sony/";
if($url =~ m/\/(.*)\//g)
{
my @result = $1;
return @result;
}
What i need is that i should be able to get anything that is between /
and /. Here i should be able to get pages-cell.net,deepan,sony into
@result but something is wrong somewhere. Please help me to solve
this?
Thanks,
Deepan
------------------------------
Date: Sat, 8 Mar 2008 12:29:59 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Perl pattern extraction
Message-Id: <7fdaa5-mi2.ln1@osiris.mauzo.dyndns.org>
Quoth "Deepan - M.Sc(SE) - 03MW06" <deepan.17@gmail.com>:
> Hi,
>
> my $url = "/pages-cell.net/deepan/sony/";
>
> if($url =~ m/\/(.*)\//g)
> {
> my @result = $1;
> return @result;
> }
>
> What i need is that i should be able to get anything that is between /
> and /. Here i should be able to get pages-cell.net,deepan,sony into
> @result but something is wrong somewhere. Please help me to solve
> this?
* is greedy by default, meaning it matches as much as possible. So you
either make it not greedy
m!/(.*?)/!g
or you are more specific about what can match
m!/([^/]*)/!g
. Note that m//g in an 'if' clause will only return the first match,
making the /g somewhat pointless.
If you were thinking that
my @result = $1;
would assign *all* the matches to @result, then you have misunderstood
how scalar variables work in Perl. $1 can only ever contain one value.
If you want to split $url on slashes, you can just use split:
my @result = split '/', $url;
shift @result;
Ben
>
> Thanks,
> Deepan
------------------------------
Date: Sat, 08 Mar 2008 13:34:41 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl pattern extraction
Message-Id: <63ffjmF26p7cvU1@mid.individual.net>
Deepan - M.Sc(SE) - 03MW06 wrote:
>
> my $url = "/pages-cell.net/deepan/sony/";
>
> if($url =~ m/\/(.*)\//g)
> {
> my @result = $1;
> return @result;
> }
>
> What i need is that i should be able to get anything that is between /
> and /. Here i should be able to get pages-cell.net,deepan,sony into
> @result but something is wrong somewhere. Please help me to solve
> this?
my @result = $url =~ m#/(.*?)(?=/)#g;
Better yet:
my @result = split /\//, $url;
perldoc -f split
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 8 Mar 2008 05:48:25 -0800 (PST)
From: "Deepan - M.Sc(SE) - 03MW06" <deepan.17@gmail.com>
Subject: Perl pattern matching and extraction
Message-Id: <6a6b7d89-1477-4d2a-8856-295223af1201@e6g2000prf.googlegroups.com>
Hi,
I would like to thank everyone for their help to my previous
post. Actually i didn't explained my need completely. Here's it
my $url = "/pages-cell.net/deepan/sony/";
if($url =~ m/\/(.*)\//g)
{
my @result = $1;
return @result;
}
What i need is that i should be able to extract "sony" from it. In the
sense i should be able to extract whatever that is available in the
last between "/" and "/". Please help me to solve this.
Thanks,
Deepan
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1343
***************************************