[30344] in Perl-Users-Digest
Perl-Users Digest, Issue: 1587 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 29 09:09:40 2008
Date: Thu, 29 May 2008 06:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 29 May 2008 Volume: 11 Number: 1587
Today's topics:
Re: automatic callback for leaving a sub-routine <FBergemann@web.de>
Dependent modules and version control <Bruce.Axtens@gmail.com>
Re: FAQ 6.11 Can I use Perl regular expressions to matc <brian.d.foy@gmail.com>
Need help with a simple (I think) Perl script <rsutton43@comcast.net>
Re: Need help with a simple (I think) Perl script <devnull4711@web.de>
Re: Need help with a simple (I think) Perl script <uri@stemsystems.com>
Re: Need help with a simple (I think) Perl script <devnull4711@web.de>
Re: Need help with a simple (I think) Perl script <bill@ts1000.us>
new CPAN modules on Thu May 29 2008 (Randal Schwartz)
Re: Remove a tab with backspace? <bugbear@trim_papermule.co.uk_trim>
Re: Remove a tab with backspace? <RedGrittyBrick@SpamWeary.foo>
The telnet login fails if the user has no password <lovecreatesbeauty@gmail.com>
Re: The telnet login fails if the user has no password <ben@morrow.me.uk>
Re: The telnet login fails if the user has no password <lovecreatesbeauty@gmail.com>
Re: Variable remaining undef in one place but not anoth <whynot@pozharski.name>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 May 2008 23:24:26 -0700 (PDT)
From: Frank Bergemann <FBergemann@web.de>
Subject: Re: automatic callback for leaving a sub-routine
Message-Id: <9f145945-5845-44ec-ac43-2ffacb8d2ffc@2g2000hsn.googlegroups.com>
thanks, Ben! - this is exactly, what i was looking for.
cheers
Frank
------------------------------
Date: Thu, 29 May 2008 05:50:18 -0700 (PDT)
From: axtens <Bruce.Axtens@gmail.com>
Subject: Dependent modules and version control
Message-Id: <c7f0844e-8c75-416d-8b46-a02eb359ad0a@u6g2000prc.googlegroups.com>
G'day everyone
Context: ActiveState Perl Developers Kit, Windows XP.
With CPAN changing so often, has anyone come up with a batch/automated
mechanism to check if dependent modules have changed and then flag the
developer and/or download the updates and recompile?
With Devel::Modlist I can get a list of the modules used, e.g.
perl -d:Modlist=cpan,nocore BOSS.ctrl
which gives me
ActivePerl::Config
ActiveState::Path 1.00
AutoLoader 5.66
C:::Perl::site::lib::sitecustomize.pl
Carp 1.08
Config
Config_heavy.pl
Cwd 3.2701
Data::Trie
Exporter 5.62
Lisp::Cons
Tree::Nary 1.3
Win32::OLE 0.1709
Win32::OLE::Lite
XSLoader 0.08
constant 1.15
Similarly
cpan -O
gives
CPAN: Storable loaded ok (v2.18)
Going to read C:\Perl\cpan\Metadata
Database was generated on Wed, 28 May 2008 13:06:52 GMT
Module Name Local CPAN
-------------------------------------------------------------------------
DBD::Multiplex 2.0600 2.0700
DBD::SQLite 1.1300 1.1400
Digest::SHA 5.4600 5.4700
IPA 1.0500 1.0600
Log::Log4perl 1.1500 1.1600
Module::Pluggable 3.7000 3.8000
Regexp::Common 2.1200 2.1220
Regexp::Common::SEN 2.1020 2.1040
Regexp::Common::URI 2.1080 2.1100
--- cut for brevity's sake ---
I can see where I can go with this, and could come up with something
useful, but I'd rather not reinvent the toasted cheese sandwich.
Kind regards,
Bruce.
------------------------------
Date: Thu, 29 May 2008 14:53:50 +0200
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.11 Can I use Perl regular expressions to match balanced text?
Message-Id: <290520081453506490%brian.d.foy@gmail.com>
In article <0ggvg5-6m2.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
<ben@morrow.me.uk> wrote:
> Quoth PerlFAQ Server <brian@stonehenge.com>:
> >
> > 6.11: Can I use Perl regular expressions to match balanced text?
> > x<recursion>
>
> This should presumably be X<recursion>.
Thanks, fixed.
------------------------------
Date: Wed, 28 May 2008 23:01:41 -0400
From: "Dick Sutton" <rsutton43@comcast.net>
Subject: Need help with a simple (I think) Perl script
Message-Id: <m4OdnZttx5K6gaPVnZ2dnUVZ_qfinZ2d@comcast.com>
First of all, I am a rank amateur at Perl. Here is my problem: I have a
hundred or more files in a directory on a web server (let's call it
'Library'). Each file is a pdf file and is named 'yyyymmm.pdf' where yyyy
is the year (i.e. 2007) and mmm is the first 3 letters of the month (i.e.
Jan). So a typical file name looks like '2007Jan.pdf'.
I wrote a simple html page using FORM that allows the user to select the
year and the month and then press the SUBMIT button and I want the
respective pdf file returned into the users browser. The problem is, I
don't know how to return a pdf file to the browser.
Here's what I have so far:
#!/usr/local/bin/perl -wT
use strict;
use CGI ':standard';
# declare variables...
my $year;
my $month;
my $pdffile;
# get the parameters...
$year = param('Year');
$month = param('Month');
# construct the relative pathname to the actual PDF file
$pdffile = '../Library/'.$Year.$Month.'.pdf';
print 'Content-type: application/pdf\n\n';
This is where I'm stuck. Can someone push me in the right direction. I
would think it should be trivial. I just don't know how to procede.
Thanks in advance...
Dick
------------------------------
Date: Thu, 29 May 2008 06:26:17 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a6pjmF35n6sjU4@mid.individual.net>
Dick Sutton wrote:
>
> Here's what I have so far:
>
> #!/usr/local/bin/perl -wT
> use strict;
> use CGI ':standard';
>
> # declare variables...
> my $year;
> my $month;
> my $pdffile;
>
> # get the parameters...
> $year = param('Year');
> $month = param('Month');
>
> # construct the relative pathname to the actual PDF file
> $pdffile = '../Library/'.$Year.$Month.'.pdf';
>
> print 'Content-type: application/pdf\n\n';
>
> This is where I'm stuck. Can someone push me in the right direction. I
> would think it should be trivial. I just don't know how to procede.
$\ = undef;
open my $fh,'<',$pdffile or die $!;
print <$fh>;
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: Thu, 29 May 2008 05:33:33 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <x7lk1toes2.fsf@mail.sysarch.com>
>>>>> "FS" == Frank Seitz <devnull4711@web.de> writes:
FS> $\ = undef;
that should be $/. this is another reason File::Slurp is useful. no need
to know this.
FS> open my $fh,'<',$pdffile or die $!;
FS> print <$fh>;
use File::Slurp ;
print read_file( $pdffile ) ;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Thu, 29 May 2008 07:49:29 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a6uflF35n6sjU5@mid.individual.net>
Uri Guttman wrote:
>>>>>>"FS" == Frank Seitz <devnull4711@web.de> writes:
>
> FS> $\ = undef;
>
> that should be $/.
You are right. The code works anyway (because
print provides a list context).
> this is another reason File::Slurp is useful. no need
> to know this.
>
> FS> open my $fh,'<',$pdffile or die $!;
> FS> print <$fh>;
>
> use File::Slurp ;
> print read_file( $pdffile ) ;
There is one disadvantage: File::Slurp is not in the core.
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: Thu, 29 May 2008 02:34:50 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <7c884fc7-6617-4c3b-a867-ce3a7663526c@c58g2000hsc.googlegroups.com>
On May 28, 11:01=A0pm, "Dick Sutton" <rsutto...@comcast.net> wrote:
> First of all, I am a rank amateur at Perl. =A0Here is my problem: I have a=
> hundred or more files in a directory on a web server (let's call it
> 'Library'). =A0Each file is a pdf file and is named 'yyyymmm.pdf' =A0where=
yyyy
> is the year (i.e. 2007) and mmm is the first 3 letters of the month (i.e.
> Jan). So a typical file name looks like '2007Jan.pdf'.
>
> I wrote a simple html page using FORM that allows the user to select the
> year and the month and then press the SUBMIT button and I want the
> respective pdf file returned into the users browser. =A0The problem is, I
> don't know how to return a pdf file to the browser.
>
> Here's what I have so far:
>
> #!/usr/local/bin/perl -wT
> use strict;
> use CGI ':standard';
>
> # declare variables...
> my $year;
> my $month;
> my $pdffile;
>
> # get the parameters...
> $year =3D param('Year');
> $month =3D param('Month');
>
> # construct the relative pathname to the actual PDF file
> $pdffile =3D '../Library/'.$Year.$Month.'.pdf';
>
> print 'Content-type: application/pdf\n\n';
>
> This is where I'm stuck. =A0Can someone push me in the right direction. =
=A0I
> would think it should be trivial. =A0I just don't know how to procede.
>
> Thanks in advance...
>
> Dick
Unless you do not want the visitor knowing where the pdffile is on
your server, I would use the following instead of the print 'Content-
type: application/pdf\n\n';
print "Location: yourwebdomain/Library/$pdffile\n\n";
This way you are not streaming the pdffile through perl and are
instead letting the server just serve it up. Also you should check
that the $year and $month are valid entries on the off chance that
someone tries to feed the script bogus or empty values.
Bill H
------------------------------
Date: Thu, 29 May 2008 04:42:21 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu May 29 2008
Message-Id: <K1M52L.1DqK@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.
API-Plesk-1.04
http://search.cpan.org/~nrg/API-Plesk-1.04/
OOP interface to the Plesk XML API (http://www.parallels.com/en/products/plesk/).
----
Apache2-ASP-1.48
http://search.cpan.org/~johnd/Apache2-ASP-1.48/
Perl extension for ASP on mod_perl2.
----
Bundle-OpenXPKI-0.05
http://search.cpan.org/~alech/Bundle-OpenXPKI-0.05/
A bundle to install modules required for OpenXPKI
----
Business-OnlinePayment-Skipjack-0.03
http://search.cpan.org/~ivan/Business-OnlinePayment-Skipjack-0.03/
Skipjack backend module for Business::OnlinePayment
----
Catalyst-View-Mason-0.16
http://search.cpan.org/~flora/Catalyst-View-Mason-0.16/
Mason View Class
----
Class-MOP-0.57
http://search.cpan.org/~stevan/Class-MOP-0.57/
A Meta Object Protocol for Perl 5
----
Exception-Died-0.02
http://search.cpan.org/~dexter/Exception-Died-0.02/
Convert simple die into real exception object
----
File-Queue-1.00
http://search.cpan.org/~jlavold/File-Queue-1.00/
Persistent FIFO queue implemented in pure perl!
----
HTML-Stream-1.57
http://search.cpan.org/~dstaal/HTML-Stream-1.57/
HTML output stream class, and some markup utilities
----
HTML-Truncate-0.12
http://search.cpan.org/~ashley/HTML-Truncate-0.12/
(beta software) truncate HTML by percentage or character count while preserving well-formedness.
----
HTML-TurboForm-0.09
http://search.cpan.org/~camelcase/HTML-TurboForm-0.09/
----
HTTP-Engine-0.0.9
http://search.cpan.org/~yappo/HTTP-Engine-0.0.9/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine)
----
HTTPEx-Declare-0.01
http://search.cpan.org/~yappo/HTTPEx-Declare-0.01/
Declarative HTTP::Engine
----
Helios-1.19_06
http://search.cpan.org/~lajandy/Helios-1.19_06/
----
Helios-Panoptes-1.29_02
http://search.cpan.org/~lajandy/Helios-Panoptes-1.29_02/
CGI::Application providing web admin interface to Helios distributed job processing system
----
JS-YUI-Loader-0.06
http://search.cpan.org/~rkrimen/JS-YUI-Loader-0.06/
Load (and cache) the Yahoo JavaScript YUI framework
----
JavaScript-Minifier-XS-0.03
http://search.cpan.org/~gtermars/JavaScript-Minifier-XS-0.03/
XS based JavaScript minifier
----
Language-Lisp-ECLs-0.24
http://search.cpan.org/~vkon/Language-Lisp-ECLs-0.24/
Perl extension for ECL lisp
----
Lingua-Stardict-Gen-0.02_1
http://search.cpan.org/~jjoao/Lingua-Stardict-Gen-0.02_1/
Stardict dictionary generator
----
Locale-Maketext-1.13
http://search.cpan.org/~ferreira/Locale-Maketext-1.13/
framework for localization
----
Mirror-JSON-0.01
http://search.cpan.org/~adamk/Mirror-JSON-0.01/
Mirror Configuration and Auto-Discovery
----
Moose-0.46
http://search.cpan.org/~stevan/Moose-0.46/
A postmodern object system for Perl 5
----
NTLM-1.04
http://search.cpan.org/~buzz/NTLM-1.04/
An NTLM authentication module
----
Net-FriendFeed-0.83
http://search.cpan.org/~kappa/Net-FriendFeed-0.83/
Perl interface to FriendFeed.com API
----
Net-SFTP-Foreign-1.37_07
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.37_07/
SSH File Transfer Protocol client
----
Net-SMS-2Way-0.03
http://search.cpan.org/~lengel/Net-SMS-2Way-0.03/
BulkSMS API
----
ORLite-Mirror-0.02
http://search.cpan.org/~adamk/ORLite-Mirror-0.02/
Extend ORLite to support remote SQLite databases
----
ORLite-Mirror-0.03
http://search.cpan.org/~adamk/ORLite-Mirror-0.03/
Extend ORLite to support remote SQLite databases
----
ORLite-Mirror-0.04
http://search.cpan.org/~adamk/ORLite-Mirror-0.04/
Extend ORLite to support remote SQLite databases
----
PAR-Dist-0.31
http://search.cpan.org/~smueller/PAR-Dist-0.31/
Create and manipulate PAR distributions
----
POE-Component-Client-HTTP-0.84
http://search.cpan.org/~rcaputo/POE-Component-Client-HTTP-0.84/
a HTTP user-agent component
----
POE-Component-Server-Bayeux-0.01
http://search.cpan.org/~ewaters/POE-Component-Server-Bayeux-0.01/
Bayeux/cometd server implementation in POE
----
POE-XUL-0.0406
http://search.cpan.org/~gwyn/POE-XUL-0.0406/
Framework for remote XUL application in POE
----
PerlIO-Util-0.20
http://search.cpan.org/~gfuji/PerlIO-Util-0.20/
A selection of general PerlIO utilities
----
Rose-DB-0.744
http://search.cpan.org/~jsiracusa/Rose-DB-0.744/
A DBI wrapper and abstraction layer.
----
Rose-DB-Object-0.770
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.770/
Extensible, high performance object-relational mapper (ORM).
----
Rose-HTML-Objects-0.554
http://search.cpan.org/~jsiracusa/Rose-HTML-Objects-0.554/
Object-oriented interfaces for HTML.
----
Rose-Object-0.85
http://search.cpan.org/~jsiracusa/Rose-Object-0.85/
A simple object base class.
----
Sledge-Plugin-JSON-XS-0.02
http://search.cpan.org/~tokuhirom/Sledge-Plugin-JSON-XS-0.02/
JSON::XS wrapper for Sledge
----
TM-Corpus-0.04
http://search.cpan.org/~drrho/TM-Corpus-0.04/
Topic Maps, Document Corpus
----
Test-SMTP-0.04
http://search.cpan.org/~jlmartin/Test-SMTP-0.04/
Module for writing SMTP Server tests
----
W3C-LogValidator-1.3.1
http://search.cpan.org/~oliviert/W3C-LogValidator-1.3.1/
The W3C Log Validator - Quality-focused Web Server log processing engine
----
WSO2-WSF-Perl-v1.1
http://search.cpan.org/~chintana/WSO2-WSF-Perl-v1.1/
----
WWW-CDTV-0.01
http://search.cpan.org/~yusukebe/WWW-CDTV-0.01/
Get a weekly music ranking from CDTV ( Japanese TV Program )
----
WebService-AngelXML-Auth-0.14
http://search.cpan.org/~mrdvt/WebService-AngelXML-Auth-0.14/
Generates XML Authentication Document for Angel Web service
----
XML-Liberal-0.19
http://search.cpan.org/~miyagawa/XML-Liberal-0.19/
Super liberal XML parser that parses broken XML
----
stockmonkey-1.0
http://search.cpan.org/~jettero/stockmonkey-1.0/
----
stockmonkey-1.1
http://search.cpan.org/~jettero/stockmonkey-1.1/
----
stockmonkey-1.2
http://search.cpan.org/~jettero/stockmonkey-1.2/
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Thu, 29 May 2008 10:33:25 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Remove a tab with backspace?
Message-Id: <f-idnWf1R7f45aPVnZ2dnUVZ8vqdnZ2d@posted.plusnet>
valerie.seigneur@googlemail.com wrote:
> Hi,
>
> I'd like to use "\b" to delete a tab character, but it doesn't seem to
> work. I've found several posts about the backspace character, but none
> about this particular problem.
>
> perl -e 'print "AB\bC\n";'
> works fine and prints "AC"
No it doesn't. Try piping it to a hex dump program, or to a file,
and examine what you get.
BugBear
------------------------------
Date: Thu, 29 May 2008 10:49:41 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Remove a tab with backspace?
Message-Id: <483e7c38$0$26092$db0fefd9@news.zen.co.uk>
bugbear wrote:
> valerie.seigneur@googlemail.com wrote:
>> Hi,
>>
>> I'd like to use "\b" to delete a tab character, but it doesn't seem to
>> work. I've found several posts about the backspace character, but none
>> about this particular problem.
>>
>> perl -e 'print "AB\bC\n";'
>> works fine and prints "AC"
>
> No it doesn't. Try piping it to a hex dump program, or to a file,
> and examine what you get.
>
Or try this
$ perl -e 'print "12\b\n"'
12
--
RGB
------------------------------
Date: Wed, 28 May 2008 19:30:16 -0700 (PDT)
From: "lovecreatesbea...@gmail.com" <lovecreatesbeauty@gmail.com>
Subject: The telnet login fails if the user has no password
Message-Id: <6666553d-a902-49a1-b250-689571946f5c@w4g2000prd.googlegroups.com>
The telnet login fails if the user has no password. I mean the user is
not prompted with the ``Password:'' string and log in, as shown in
below case 2.
$cnn->login($user, $pass);
It works in case 1. How can I make a script work with both cases?
Thank you.
CASE 1:
$ telnet 192.168.4.30
Trying 192.168.4.30...
Connected to 192.168.4.30.
Escape character is '^]'.
login: guest
Password:
[guest@BS2000e-1 ~]$ exit
logout
Connection closed by foreign host.
$
CASE 2:
$ telnet 192.168.5.10
Trying 192.168.5.10...
Connected to 192.168.5.10.
Escape character is '^]'.
login: guest
[guest@BS3000e-0 test]$ exit
logout
Connection closed by foreign host.
$
------------------------------
Date: Thu, 29 May 2008 04:00:42 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: The telnet login fails if the user has no password
Message-Id: <qri1h5-gn22.ln1@osiris.mauzo.dyndns.org>
Quoth "lovecreatesbea...@gmail.com" <lovecreatesbeauty@gmail.com>:
> The telnet login fails if the user has no password.
I sincerely hope you have good firewalls, if you are allowing telnet
logins without a password.
> I mean the user is not prompted with the ``Password:'' string and log
> in, as shown in below case 2.
>
> $cnn->login($user, $pass);
>
> It works in case 1. How can I make a script work with both cases?
As it says in the docs, if ->login doesn't do what you want, use ->print
and ->waitfor instead.
Ben
--
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks] ben@morrow.me.uk
------------------------------
Date: Wed, 28 May 2008 20:40:07 -0700 (PDT)
From: "lovecreatesbea...@gmail.com" <lovecreatesbeauty@gmail.com>
Subject: Re: The telnet login fails if the user has no password
Message-Id: <b530e158-c7d5-4534-85e2-d25468613b65@j1g2000prb.googlegroups.com>
On May 29, 11:00 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth "lovecreatesbea...@gmail.com" <lovecreatesbea...@gmail.com>:
>
> > The telnet login fails if the user has no password.
>
> I sincerely hope you have good firewalls, if you are allowing telnet
> logins without a password.
>
> > I mean the user is not prompted with the ``Password:'' string and log
> > in, as shown in below case 2.
>
> > $cnn->login($user, $pass);
>
> > It works in case 1. How can I make a script work with both cases?
>
> As it says in the docs, if ->login doesn't do what you want, use ->print
> and ->waitfor instead.
>
Thanks, I just read it. Does ->print display password on terminal and
anybody sees it? Does the ->login work this way also?
------------------------------
Date: Wed, 28 May 2008 23:19:48 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Variable remaining undef in one place but not another.
Message-Id: <4cr0h5x2hn.ln2@orphan.zombinet>
Justin C <justin.0805@purestblue.com> wrote:
*SKIP*
> sub getPage{
> my $rv = `../docs/getCwd.pl`;
Check if B<getCwd.pl> really runs (examine C<$?>, it's set for backticks
too).
> return $rv;
> }
*SKIP*
> Here is getCwd.pl:
> #!/usr/bin/perl
> use warnings;
> use strict;
> use Cwd;
> my $path = (cwd() =~ /^\/+.*\/(.*)$/);# get just the last part of the path
I believe you don't know what you are doing. I see no reason to match
leading slash B<at least once>, then possibly nothing, then one more
slash, then you grab possibly nothing again; everything that is wrapped
in list, what is scalarized, and that number of items is discarded.
> print "$1";
consider this C<print pop split m{/}, cwd>
(one more) I'm neither B<CGI> nor B<httpd> expert, and possibly I'm
overestimate, and surely I don't know what I'm talking about, but... Do
me only feel B<chroot> smell? (I meant, wouldn't you like to see what
B<cwd> actually returns.)
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
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 1587
***************************************