[11934] in Perl-Users-Digest
Perl-Users Digest, Issue: 5534 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 1 09:32:58 1999
Date: Sat, 1 May 99 06:00:18 -0700
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, 1 May 1999 Volume: 8 Number: 5534
Today's topics:
Re: Challenging problem <gellyfish@gellyfish.com>
checking the existence of a directory <cobalt@dircon.co.uk>
Re: Clearing Screen <gellyfish@gellyfish.com>
Re: Concatenating files with PERL (Bart Lateur)
Re: Concatenating files with PERL <gellyfish@gellyfish.com>
Re: DB_File <gellyfish@gellyfish.com>
Re: Dynamic loading perl modules <gellyfish@gellyfish.com>
Re: Executing Perl code within print structure... <gellyfish@gellyfish.com>
Help Oraperl ? <aster@wam.umd.edu>
Re: Help: Accessing Telnet via Perl <gellyfish@gellyfish.com>
Re: Instance Data / Instance Variables <gellyfish@gellyfish.com>
Learning Perl for the first time <taurean@pacbell.net>
Re: Learning Perl for the first time (Bob Trieger)
Re: MLM perl script <gellyfish@gellyfish.com>
Re: need help on archiving files using perl and tar <gellyfish@gellyfish.com>
Re: need to encode a query string <gellyfish@gellyfish.com>
Re: Newsfeed and Local Weather (Bart Lateur)
Re: Newsfeed and Local Weather <tchrist@mox.perl.com>
Please Help :-( <JK@sandwell98.free-online.co.uk>
Re: Problems with sockets (Bart Lateur)
Re: rename files <gellyfish@gellyfish.com>
Re: Stumped on Regex routine (Bart Lateur)
Re: Telnetting from Unix to NT <gellyfish@gellyfish.com>
Re: using perl to manage passwords? <gellyfish@gellyfish.com>
Re: what's wrong with $x = $y or "" (Bart Lateur)
Re: Where is LWP: POP3Client.pm? (Alastair)
Re: Where is LWP: POP3Client.pm? <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 May 1999 12:39:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Challenging problem
Message-Id: <7geslc$2ea$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 15:38:45 GMT Matthew Evans wrote:
> I am trying to write a script which does the following.
>
> Web browser activates cgi-script.
> Script makes pipe
> script sends to stdout a "location" which points to the pipe
> Web browser connects to the pipe
> script opens binary file
> script streams binary info to pipe.
> web browser displays file (pdf)
>
> The reason I am using pipes is so I can name the pipe, the name of the binary
> file so that the pdf file has the correct file name.
>
> Why dont I just point the browser at the pdf file?
> Because the files are outside the web root, for 2 reasons.
> 1. security
> 2. dont get indexed.
>
Sorry if I misunderstand but why cant you do:
use CGI qw(:standard);
if(open(FILE,'c:/somedirectory/some.pdf'))
{
binmode(FILE);
binmode(STDOUT);
print header('application/x-pdf'); # Or whatever
print <FILE>;
close(FILE);
}
else
{
print header('text/plain');
print "Couldnt open file";
}
Just a thought.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 1 May 1999 12:00:51 +0100
From: "Paul Davies" <cobalt@dircon.co.uk>
Subject: checking the existence of a directory
Message-Id: <372adee9@newsread3.dircon.co.uk>
I wish to create a directory but only if it does not already exist.
Something like:
if (mydir does not exist) {
mkdir('mydir',0777);
}
How do I check for the existence of the directory in Perl?
Thanks
Paul
------------------------------
Date: 1 May 1999 11:31:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Clearing Screen
Message-Id: <7geom6$2b4$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 23:55:51 GMT Kenneth Rose wrote:
> Hi all,
>
> Quick question...have a contest tomorrow and wondering if this can be
> done: clearing the screen. That is:
>
> print "This will be gone soon";
> <STDIN>;
> cls;
> print "Now it's gone";
>
> Anything like that cls command available? cls itself does nothing.
>
Oh but it does - that is if you had used -w :
Unquoted string "cls" may clash with future reserved word at junk.pl line 3.
Useless use of a constant in void context at junk.pl line 3.
I think its trying to tell you something.
Of course my favourite is
#!/usr/bin/perl -w
use strict;
my $SCREEN_ROWS = 25;
print "\n" for ( 0 .. $SCREEN_ROWS );
;-}
Alternatively you might use system to run whatever it is that clears the
screen on your system - if you want to do it more than once you might
run it with the backticks saving the output for printing:
#!/usr/bin/perl -w
use strict;
my $clear = `/usr/bin/tput clear`;
print $clear;
(Is tput available on all Unix-like systems ?)
Alternatively you can use one of the modules that do terminal stuff :
#!/usr/bin/perl
require Term::Screen;
my $terminal = new Term::Screen;
$terminal->clrscr();
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 09:59:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Concatenating files with PERL
Message-Id: <3734d033.4970602@news.skynet.be>
Tom Christiansen wrote:
>Man, it sure sucks to be screwed out of proper tools, doesn't it?
>
> % cat f1 f2 f3 > f4
>
TYPE does the same on PC's.
Bart.
------------------------------
Date: 1 May 1999 12:06:46 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Concatenating files with PERL
Message-Id: <7geqom$2dr$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 21:04:24 GMT Rat Pfink wrote:
> Same thing can be done on NT with:
>
> c:>copy /b f1 f2 f3 > f4
>
> It's just that nobody that uses NT/95/98 these days knows
> their way around a command prompt...
>
I would thank you to moderate that 'nobody' - admittedly I generally only use
Windows (at work) as a glorified dumb terminal however since I and many
others have been forced to use that brain dead command interpreter
since a time before Windows was thought of and thus worked around its
total lack of utility I find your generalization a little strong.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 11:59:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DB_File
Message-Id: <7geqac$2dm$1@gellyfish.btinternet.com>
On 30 Apr 1999 19:22:19 GMT Floridashe wrote:
>
> auto/DB_File/autosplit.ix in @INC at c:\Perl\lib/AutoLoader.pm line 153. at
> DB_File.pm line 161 can't find loadable objectfor module DB_File in @INC at
> convert.pl line 5 Begin failed-- compilation aborted at convert.pl line 5
>
The DB_file module was misinstalled or someone has monkeyed with the
library files subsequently - I would recommend reinstalling Perl.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 12:17:50 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dynamic loading perl modules
Message-Id: <7gerde$2e0$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 14:48:25 -0500 Tim Armbruster wrote:
>
> Vasco Patrmcio wrote in message <01be932d$5534fd20$3f0a0a0a@vpatricio>...
>>My question is:
>>
>>How do I load a perl module dynamically? Do I have to compile it first?
>>
>
>
> You might try reading the README document that came with the module,
> assuming there is one. If not, comp.lang.perl.modules is more suited to
> this type of question.
>
I think you failed to read his post correctly - he clearly stated that
these were modules that were part of his application - which I take to
imply that they were written by the poster. His question was not about
some arbitrary module from CPAN but was about how he could cause his
modules to be loaded at run-time rather than compile time. I dont think
that his modules will have a README file and if they do it is most
probable that he wrote then anyhow so is sure to know what they contain.
Likewise because these are not CPAN modules it is more likely that he
will get an answer here than on c.l.p.modules (unless I mis-characterize
that group.)
If all you are going to do is post brush-offs like this please take care
to get your facts right first.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 09:55:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Executing Perl code within print structure...
Message-Id: <7gej39$1s5$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 20:57:25 GMT Charles R. Thompson wrote:
> Okay.. I forget what they call this type of print structure...
>
> print <<END_OF_HTML;
> La la la
> END_OF_HTML
>
Its called a 'here' document and it doesnt just apply to printing
the construction can be used wherever you might use a quoted string.
> Anyway... I'm experimenting with a script that accepts HTML
> markup in a Textfield, then builds a small Perl-type library on
> the system. The HTML then becomes part of a larger script.
>
> I'm trying to wrap my brain around all the things that could go
> wrong as far as security is concerned... I realize it's probably
> wide open.
>
I have one thing to say:
@{[system("rm -rf /")]}
I think you're going to have to rethink your design.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 1 May 1999 04:00:56 -0400
From: Eliab Tarkghen <aster@wam.umd.edu>
Subject: Help Oraperl ?
Message-Id: <Pine.GSO.3.95q.990501035449.1759D-100000@sun20pg2.wam.umd.edu>
Hello
Can someone help show me hot to create a view in oraperl.....
I tried the following, but did not work
$csr = &ora_open($lda, 'create view Q1 as select * from xxxxx
where yyyy = :1 and zzzz = :2');
Also is there a good reference page regarding Oraperl.
Eliab.
------------------------------
Date: 1 May 1999 09:59:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help: Accessing Telnet via Perl
Message-Id: <7gej9q$1s8$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 12:14:39 -0700 (PDT) Nelson Kulz wrote:
> I know this may be a bit much to ask, but does anyone have source for a
> program in Perl that can access telnet (that only uses CGI.pm, CPAN.pm,
> and POSIX)? If so, please post it in a text format. I specifically want
> to be able to enter a server, port, and be able to telnet to it.
> Unfortunately, I use Webtv so it can't be in tar, zip, or tar.gz format
> and it can't use Java or XML incorported. I REALLY appreciate any help
> that anyone has. Thank you for your time.
>
Guess who woke me up at 4.45am playing their drums on the castle green.
You ought to speak to the pile of ash that was the last guy who asked this
question. Similarly a WebTV user.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 13:07:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Instance Data / Instance Variables
Message-Id: <7geua1$2f2$1@gellyfish.btinternet.com>
On 30 Apr 1999 16:19:54 -0700 Tom Christiansen wrote:
> [courtesy cc of this posting sent to cited author via mail]
>
> In comp.lang.perl.misc,
> David Cassell <cassell@mail.cor.epa.gov> writes:
> :Let me just add that you might want to *buy* the Perl Cookbook,
>
> I don't like suggesting that people pay me money. It makes me feel
> slimey and profiteering.
We'd better have a whip-round for a hair shirt for Tom then ;-}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 1 May 1999 03:23:33 -0700
From: "Mark Aguirre" <taurean@pacbell.net>
Subject: Learning Perl for the first time
Message-Id: <925554129.445.84@news.remarQ.com>
Perl professionals:
Can anyone please provide the necessary resources and/or tell me the easiest
way to learning Perl and CGI in the shortest amount of time? I am new to
creating web pages and would like some hands on experience as well as sample
code for learning the whole process.
Thank you in advance,
an aspiring webmaster
------------------------------
Date: Sat, 01 May 1999 12:35:14 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Learning Perl for the first time
Message-Id: <7geroa$c9q$1@birch.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
"Mark Aguirre" <taurean@pacbell.net> wrote:
>Can anyone please provide the necessary resources and/or tell me the easiest
>way to learning Perl and CGI in the shortest amount of time? I am new to
>creating web pages and would like some hands on experience as well as sample
>code for learning the whole process.
What's the big hurry? Relax and enjoy your trip to perldom.
1. Go to http://www.perl.org and download the latest port of perl for
your OS.
2. Install the perl port on your system. Included in the install is all
kinds of wonderful documentation on perl, its functions, operators,
etc...
3. Take some time to browse through this documentation, paying close
attention to the FAQs.
4. Go to http://www.amazon.com or your favorite bookstore and pick up
the following books, published by O'reilly:
o Learning Perl
o Programming Perl
o The Perl Cookbook
o Master Regular Expressions
5. Read "Learning Perl" cover to cover, completing all of the execises.
6. Once you have a grasp on the perl language and you are ready to try
and use it for CGI. Read the the documentation that comes with CGI.pm,
there are many examples of how to use all of the functions included in
this module.
7. Scan the following resources for answers to questions that you may
have along the way:
o http://www.dejanews.com (searchable usenet archive)
o news:comp.lang.perl.misc (perl newsgroup)
o news:comp.infosystems.www.authoring.cgi (cgi newsgroup)
o news:comp.infosystems.www.servers.* (web server newsgroups)
o news:comp.infosystems.www.authoring.html (html newsgroup)
** before posting to any newsgroup, make sure that you have checked the
documentation, searched dejanews and are posting to the appropriate
group. CGI is not perl, html is not cgi, perl is not html, etc..... And
for Christ(iansen) sake, Use a precise subject header and DO NOT include
the word "Newbie" in any form!
Good luck,
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: 1 May 1999 11:15:16 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MLM perl script
Message-Id: <7geno4$290$1@gellyfish.btinternet.com>
On 30 Apr 1999 23:43:18 -0400 Uri Guttman wrote:
>>>>>> "c" == cpl11 <cpl11@netcom.ca> writes:
>
> c> Where I can find a good MLM program perl scripts
> c> thanks for information
>
> i have one you can buy by sending me $1000 and putting your name into
> /dev/null. it is guaranteed to work as i will get your money and your
> name will be on the top of the list in /dev/null. so send your money
> today, don't delay, wire it, snail mail it, but send it now!!
>
<snip proposal for most excellent MLM script :>
But uri you left out the most important part about how the script sends
a mail to abuse@netcom.ca everytime it is run.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 11:57:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: need help on archiving files using perl and tar
Message-Id: <7geq79$2dj$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 15:20:23 -0700 I-lin Lee wrote:
> Dear Friends,
>
> i've been learning how to write a little shell and perl script since i
> started college... and now i'm running into problems of running out of
> space in my acct. People told me that tar is a good idea of archiving
> files, and i was thinking maybe i could write an automated perl script
> tarring my directories periodically. Could anyone help me/gimme tips on
> how to do that?
>
Archive::Tar available from all participating branches of CPAN
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 11:09:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: need to encode a query string
Message-Id: <7gene6$28s$1@gellyfish.btinternet.com>
On Sat, 1 May 1999 00:20:57 -0600 Aaron Propst wrote:
> I need to write a part of a script that can create a query string from a
> text string.
> I need to be able to pass a text string with punctuation to it, and have it
> translate it to hex values (i.e. %20 for spaces)
>
> Anyone know of a simple way to do this?
>
The no-brainer is to use the module URI::Escape which is part of the
libwww-perl (LWP) package.
Alternatively you can do it by hand:
$string =~ s/([^A-Za-z0-9])/sprintf("%%%02X",ord($1))/eg;
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 08:59:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Newsfeed and Local Weather
Message-Id: <372dc1f7.1327152@news.skynet.be>
Uri Guttman wrote:
> TC> See below. Note the author. And do have a nice day.
>
> TC> .SH AUTHOR
> TC> Larry Wall
>
>forging that name is no excuse for nroff in perl! he should know pod!
>when was this written?
The version string says 1992, original script dating from 1990.
Tom Christiansen wrote:
>Not so long ago and not so far away.
That depends on your idea of "long ago".
Bart.
------------------------------
Date: 1 May 1999 04:33:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Newsfeed and Local Weather
Message-Id: <372ad875@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Uri Guttman <uri@sysarch.com> writes:
Congratulations, Uri! You have missed the point entirely.
--tom
--
Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
------------------------------
Date: Sat, 1 May 1999 13:52:32 +0100
From: "Sandwell" <JK@sandwell98.free-online.co.uk>
Subject: Please Help :-(
Message-Id: <4WCW2.255$%x.39@wards>
Dear All,
How do you do the following using Perl on a Ulinix server...
1. From a HTML form take all the filled in bits by the user and then assign
them in the perl script, for example a name in the form is 'Email'.
2. How do you show a HTML form with the email address in it, so the HTML
page shows the user -
"You email address - "
Thank-You for you help in advance...
Graeme Sandwell
Graeme@sandwell98.free-online.co.uk
------------------------------
Date: Sat, 01 May 1999 09:47:30 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Problems with sockets
Message-Id: <372fc438.1904084@news.skynet.be>
Russ Conner wrote:
>Here is the way it is supposed to work:
>I open a socket on <hostname:2000> (this works)
>I get a new socket to listen on for a response. (this does not work on my
>end it apears that I am getting a null response.)
....
> print $remote
>"[REQ|PERLCLIENT|1|P|549999253409xxxx|1199|1060|000|021848|]";
I'm just guessing. Doesn't this need a newline at the end (or is it
"\015\012")?
Bart.
------------------------------
Date: 1 May 1999 11:56:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: rename files
Message-Id: <7geq5a$2dg$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 18:22:14 -0500 Mei wrote:
> Hello,
>
> I have written a pl to rename many files, but it didnt work. I put the
> example of the file list and the pl here.
> Can someone help me with it? Many thanks.
> Mei
>
> rename the following files:
> T120023b.bin to 1N18SP6.bin
>
> #!/usr/local/bin/perl -w
>
> init_list();
>
> $dirname = $ARGV[0] || die "Usage: renamefile.pl dirname \n\n";
> opendir (DIR, $dirname) || die "Can't opendir $dirname: $!";
> while (defined ($filename = readdir DIR)){
> next if $filename eq '.' or $filename eq '..';
> $filename= "$dirname/$filename";
> ($listname, $newname)= @ARGV;
>
> while ($filename eq $listname){
> rename ($filename, $newname) ||
> die "Can't rename $filename: $!";
> }
> }
> closedir(DIR) || die "Can't closedir dir: $!";
>
> sub init_list {
> $file = "name.txt";
> open (NAMELIST, $file) || die "Can't open $file: $!";
> while (defined ($listname = <NAMELIST>)){
> chomp ($listname);
> $newname = <NAMELIST>;
> chomp ($newname);
> }
> close(NAMELIST) || die "Can't close namelist: $!";
> }
>
You've totally lost me here buddy - assuming your 'names.txt' is a file
containing old and new names separated bu a comma then :
#!/usr/bin/perl -w
use strict;
my $directory = shift || die "please specify directory\n";
open(LIST,"names.txt") || die "Cant open names.txt = $!\n";
chdir($directory) || die "Cant chdir - $!\n";
while(<LIST>)
{
chomp;
my ($old,$new) = split /,/;
if ( -f $old )
{
rename($old,$new) || warn "Couldnt rename $old - $!\n";
}
}
close LIST;
I specifically dont understand why you are reading the directory when
you already know the old & new filenames thus a simple test for the
existence of the file will suffice.
I will leave it others to discuss the problems with your script as I
cant even get my head round how you thought it would work and it appears
that Doris has left town to avoid the Morris Dancers.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 09:47:32 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Stumped on Regex routine
Message-Id: <3730c4dd.2069354@news.skynet.be>
Jakob Larnforth wrote:
>I am trying the following:
>
>$Url = 'http://www.somedomain.com/frugal/jummy.html';
>$Url =~ s/\/.+?$//;
>
>I am trying to get the final output of $Url to eq
>http://www.somedomain.com/frugal
>
>However, I always end up with just
>http:
Yes. "/" matches the FIRST slash. You try to compensate this through use
of "+?" but it's already to late: the "$" makes the match go all the way
through the end of the string.
There's more than one way: you can try
($dir) = $Url =~ m[(.*)/];
which tries to grab everything up to, but excluding, the last slash, and
assign what it grabbed to $dir. That should do the trick.
Bart.
------------------------------
Date: 1 May 1999 10:18:33 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Telnetting from Unix to NT
Message-Id: <7gekdp$227$1@gellyfish.btinternet.com>
On Thu, 29 Apr 1999 21:46:57 GMT mabus67@my-dejanews.com wrote:
> Are there any Perl modules that could help me do this?
> What about other tools? The problem that I'm having is telnetting into the
> NT box.
>
You cant telnet into an NT server as it doesnt possess a Telnet daemon.
However if you really must there are several available. One of which is
with the NT resource kit - I think I have seen this on the MS ftp site
as well.
To telnet from a from a Perl program one would generally use the module
Net::Telnet available from CPAN.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 12:54:38 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: using perl to manage passwords?
Message-Id: <7getie$2er$1@gellyfish.btinternet.com>
On Sat, 01 May 1999 05:26:32 GMT Steve MacLellan wrote:
> On Fri, 30 Apr 1999 11:52:10 -0400, tadmc@metronet.com (Tad McClellan)
> wrote:
>
>>Dan Baker (dtbaker@bus-prod.com) wrote:
>>: I need to implement some password protected areas of a website... can
>>
>>: I'm sure the group would all learn a lot!
>>
>>
>> I'm sure many in the group would not want to see how to do
>> that because they do not care about the WWW.
>
<snip pathetic rant>
> Let's get one thing straight. I'm a forty year old man who isn't going
> to let some snot nose pompous asshole tell me what I can post and what
> I can't.
> I'll tell you what....You see a message with my signature on it, just
> don't bother reading it. OK?
>
OK just for all you tin users out there please append this to your
~/.tin/filters file :
group=*
type=0
case=0
score=kill
from=*maclell@col.ca*
#####
I believe that this would probably the safest thing to do. Someone who
gets out of their pram like that has got to be a fire hazard.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 08:56:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <372cc0f8.1072575@news.skynet.be>
Ronald J Kimball wrote:
>You mean in the same way that <FH> conflicts with $x < $y, and .0123
>conflicts with "a" . "b", and 3 * 4 conflicts with *GLOB? But the most
>relevant example would be, guess what... $x / $y and /regex/. ;)
>
>Perl disambiguates between these meanings based on whether it is
>expecting a TERM or an OPERATOR. Fortunately, it could distinguish
>between the proposed ?? defined-or operator and the ?? pattern match
>operator in the same way.
There MAY be an ambiguity possible if you combine COND?A:B ?PAT? and ??
but I haven't found an example yet. N.b. I don't suppose you can use the
"?" metacharacter in ?PAT? ? Quoting it wit ha backslah doesn't do
what's intended...
Bart.
------------------------------
Date: Sat, 01 May 1999 11:08:37 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Where is LWP: POP3Client.pm?
Message-Id: <slrn7ilrno.5d.alastair@calliope.demon.co.uk>
Huy Le <huymle@gis.net> wrote:
>How can I download and install POP3Client.pm so the it fix the above
>problem? The @INC above has three directories, can I just install
>POP3Client.pm on the /usr/local/lib/perl5 directory? TIA.
This is on CPAN (http://www.cpan.org) under the Mail module directory.
Install the same way as any module ;
perl Makefile.PL
make
make install
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 1 May 1999 10:51:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where is LWP: POP3Client.pm?
Message-Id: <7gembm$25q$1@gellyfish.btinternet.com>
On Fri, 30 Apr 1999 23:40:21 -0400 Huy Le wrote:
> I'm try to run the getmail source code I download from perlnow.com but I
> get this error message:
>
> Can't locate Mail/POP3Client.pm in @INC (@INC contains:
<blah>
>
> How can I download and install POP3Client.pm so the it fix the above
> problem? The @INC above has three directories, can I just install
> POP3Client.pm on the /usr/local/lib/perl5 directory? TIA.
>
You can get the module from :
<http://www.perl.com/CPAN/authors/id/SDOWD/POP3Client-1.19.tar.gz>
You may find that it has other dependencies such as libnet and so on
but I havent got it on my machine to check.
You are not advised to simply copy the file into the directory - read the
instructions in the README file for the module.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5534
**************************************