[9195] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2814 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 5 07:07:14 1998

Date: Fri, 5 Jun 98 04:00:36 -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           Fri, 5 Jun 1998     Volume: 8 Number: 2814

Today's topics:
    Re: "system" output redirect <jerryp.usenet@connected.demon.co.uk>
    Re: (a simple) array problem <bowlin@sirius.com>
        [Perl + Perl/CGI Mini FAQ] Find an answer before you as <sbekman@iil.intel.com>
        access a tape-drive via perl <neu@adv.magwien.gv.at>
    Re: access a tape-drive via perl (Jonathan Stowe)
    Re: Blat problem <mbl@startext.de>
        DBM crush! <webmaster@spanishbanner.com>
    Re: decimal arithmetic (Mark Maurer)
        Help ! setup noecho connection stuart@ilanet.slnsw.gov.au
        How do I get text counter perl script to work??? adntaylor@my-dejanews.com
        How do I prevent a socket from closing? <sjackman@rogers.wave.ca>
        How do you identify the OS (Phil Taylor)
    Re: Module Net::SMTP <sbekman@iil.intel.com>
        numeric $value to string <Centollo@iname.com>
    Re: pattern match <iqbal@somewhere.com>
    Re: pattern match <iqbal@somewhere.com>
    Re: pattern match <iqbal@somewhere.com>
    Re: Perl and Javascript conflicts <quednauf@nortel.co.uk>
    Re: problem using LWP (Jonathan Stowe)
        problems compiling perl 5.004_04 in mklinux <mhickey@reed.edu>
        Q: apply func to mutate list; oneliner <xah@shell13.ba.best.com>
        Q: dispatch find/replace string <xah@shell13.ba.best.com>
    Re: Server Redirection (Martien Verbruggen)
        shadowed password <brandon@gcn.ou.edu>
        tool to cut the attachements from netscape-mailfiles <perler@dresden-online.com>
    Re: Why is there no "in" operator in Perl? <71022.3700@CompuServe.COM>
    Re: Why is there no "in" operator in Perl? <Dave.Cross@gb.swissbank.com>
    Re: Why is there no "in" operator in Perl? <tchrist@mox.perl.com>
    Re: Yes, it is <quednauf@nortel.co.uk>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 5 Jun 1998 05:21:33 +0100
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Re: "system" output redirect
Message-Id: <BFnvEWANJ3d1EwVs@connected.demon.co.uk>

In <comp.lang.perl.misc> 
Tad McClellan <tadmc@flash.net>, writes:
<deletia>
>Doesn't the auto-email for first time posters tell where to get
>the Perl FAQs.

        Erm, how will a munged address ever get that :-)

>Did you even read that email?
>
>
>--
>    Tad McClellan                          SGML Consulting
>    tadmc@metronet.com                     Perl programming
>    Fort Worth, Texas

-- 
Jerry Pank           mailto:jerryp.usenet@connected.demon.co.uk

We didn't put in ^^ because then we'd have to keep telling people what
it means, and then we'd have to keep telling them why it doesn't short
circuit.  :-/
-- Larry Wall in <199707300650.XAA05515@wall.org>


------------------------------

Date: Thu, 04 Jun 1998 23:25:57 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: ames0009@tc.umn.edu
Subject: Re: (a simple) array problem
Message-Id: <35778F75.D20F91B6@sirius.com>

ames0009@tc.umn.edu wrote:
> 
> I am writing a script that will search an html file for list items and
> prices, etc.  I am then having the script write the extracted
> information to a database file.  That is no problem.
> 
> The problem:  I want to store each occurence of a string match as an
> element in an array so that it will be easier to manipulate the
> information before it is printed to the database.
> 
> Here is an example:
> 
> if (open(MYFILE, "$f")) {
>         $line = <MYFILE>;
>         while ($line ne "") {
>                 if ($line =~ /\<li\>/) {
>                 @words = split(/.*\<li\>|\<\/li\>.*/gi, $line);
>                 print @words;
>                 }
> $line = <MYFILE>;
> 
>         }
> }
> 
> This extracts the information I want and then prints it to STDOUT.
> The trouble with this is that the array is written over with each
> iteration.  I thought the obvious solution to this was something like
> this:
> 
> @line = <MYFILE>;
> $count = 1;
> while ($count < @line) {
>         if ($line =~ /\<li\>/) {
>            $words[$count -1] = split(/.*\<li\>|\<\/li\>.*/gi, $line);
> 
> or this last line could use =~ instead of split.  Neither of these
> attempts worked - the value stored in $word[$count -1] was always
> equal to the number of succesful matches ("3" or "4" for example).
> 
> I feel I am overlooking something obvious.  Any ideas would be
> helpful.  Thanks,
> 
> T. Ames

Replace

 @words = split(/.*\<li\>|\<\/li\>.*/gi, $line);

with 

push  @words, split(/.*\<li\>|\<\/li\>.*/gi, $line);

HTH -- Jim Bowlin


------------------------------

Date: Fri, 05 Jun 1998 09:36:02 +0300
From: Bekman Stanislav <sbekman@iil.intel.com>
Subject: [Perl + Perl/CGI Mini FAQ] Find an answer before you ask. [+ Need your input]
Message-Id: <357791D2.794B@iil.intel.com>

Hi,

[Updated Fri Jun  5 09:27:27 IDT 1998]

Answers to some bothering questions (Perl + Perl/CGI Mini FAQ)  are
available for you at
http://www.eprotect.com/stas/TULARC/webmaster/myfaq.html

<NEED YOUR INPUT>
After I have announced this FAQ at first time Tom Christiansen pointed
out that the locking techniques (without flock()) I describe are not
very good, and suggested his own technique. which is better but doesn't
cover all the situations... (mostly in connectionless environment of the
web)
See item 1.* and send your comments and suggestions
http://www.eprotect.com/stas/TULARC/webmaster/myfaq.html#1
Thank you!
</NEED YOUR INPUT>

 It can help some of you to save you  and nice people, who answer your
questions here, a lot of time. It concentrates on Perl/CGI issues mostly
but there are some items that would be of interest to the rest of the
Perl community (like installing the perl5 modules in various situations,
see item 7).

Here is a Table of Contents, so you will know if you are interested to
take a look at:

     0. Usenet, Questions and Answers -- The greatest tip. 
     1. FileLocking Issues. WWW Guestbook Case. 
         1.1 Locking with flock and modifying the file by opening it
only once 
         1.2 File Locking when flock(3) or lockf(3) is unavailable 
         1.3 File Locking Issues : Summary 
         1.4 More locking techniques 
     2. Securing your CGI scripts. Untainting the form's input (A must
thing!) 
     3. Verify the email addresses 
     4. How do I pass parameters from one perl program to another thru a
shell ( solving special shell characters
     escaping problem) 
     5. Miscellaneous practical Perl5/CGI regexp 
         5.1 Cleaning the URL of '//' 
         5.2 Get rid of '^M' chars 
         5.3 %-encode URLs 
     6. Debugging CGI scripts easily 
     7.How to install perl5 modules into a local directory (when you
can't become root). Introduction to
     CPAN.pm 
         7.1 Installing the modules locally 
         7.2 Make your scripts find the modules you have installed 
         7.3 Installing new modules that require modules that have been
already installed, but installed locally 
         7.4 Making a fast and easy download/install/upgrade of perl5
modules with CPAN.pm 
     8. Links to other FAQs 
 
Remember: http://www.eprotect.com/stas/TULARC/webmaster/myfaq.html

Enjoy!

______________________________________________________________________
Stas Bekman mailto:sbekman@iname.com http://www.eprotect.com/stas  
Visit: http://www.eprotect.com/stas/TULARC (Perl,CGI,Linux,Web,Java,PC)
Linux receives a 'Product of the Year Award' for Best Technical Support
http://www.infoworld.com/cgi-bin/displayTC.pl?97poy.supp.htm


------------------------------

Date: Fri, 5 Jun 1998 08:53:40 +0200
From: "J|rgen Neustifter" <neu@adv.magwien.gv.at>
Subject: access a tape-drive via perl
Message-Id: <6l84ll$g3r@strauss.host.magwien.gv.at>

Is it possible to access a tape-drive with perl? Or is there another way to
access a tape-drive without a backup-tool?

I want to check wether a tape is in the drive or not!


--
J|rgen Neustifter
neu@adv.magwien.gv.at




------------------------------

Date: Fri, 05 Jun 1998 10:52:48 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: access a tape-drive via perl
Message-Id: <3577c1c8.89697633@news.btinternet.com>

On Fri, 5 Jun 1998 08:53:40 +0200, J|rgen Neustifter wrote :

>Is it possible to access a tape-drive with perl? Or is there another way to
>access a tape-drive without a backup-tool?
>
>I want to check wether a tape is in the drive or not!
>

I was going to suggest :

open(TAPE,"/dev/rmt0") || die "cant open tape - $! ";


But then I realized you were not a unix user and all the fun went out
of life.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



------------------------------

Date: Fri, 05 Jun 1998 08:26:06 +0200
From: Marcus Blaha <mbl@startext.de>
To: 0312@my-dejanews.com
Subject: Re: Blat problem
Message-Id: <35778F7E.429A@startext.de>

Hi anonymous

0312@my-dejanews.com wrote:
> 
> Hi seniors:
> 
> I have running iis4.0. and try to make blat work under NT, and it does
> work well before, 

Before what ?

>However it seems to be some problems now that blat refused
> to send mail again, the error message is " the smtp server does not like
> anyid@anydomain.com,  have you set 'to:' field properly"
> 

That means that your smtp-server doesn't accept fantasy sender
addresses. Are you able to send a message from command prompt ?
Fix this first. 


> I have totally lost now since i have tries to fix it myself several
> times and every try was ended in vain.
> 
>  Could anybodygive me some clue?
> 
> thanks
> 

Marcus
-- 
Marcus Blaha  				Tel.: +49.228.95996-16 
startext Unternehmensberatung GmbH	Fax.: +49.228.95996-66
Kennedyallee 2 / 53175 Bonn / Germany   Compuserve 101317,3140
http://www.startext.de                  mailto:mbl@startext.de


------------------------------

Date: Wed, 03 Jun 1998 14:13:00 +0000
From: webmaster <webmaster@spanishbanner.com>
Subject: DBM crush!
Message-Id: <357559EC.2529DC92@spanishbanner.com>

Hi all!

I have Banner Swap service and I want to store all stats abouts banners
served, user data and clicks on a DBM database, this DBM will have lot's
of accesses and maybe some of them would be concurrently to the same
data. I am in a trouble because the data is crushed and I loose all the
information stored in the database. I think this due to the concurrent
access to write some fields but I'm not sure. Can you help me? I'm a
newbie and  I need to solve this question quickly.... please,help!

Thanks.

Response to joluco@gsyc.inf.uc3m.es




------------------------------

Date: 5 Jun 1998 01:52:21 -0400
From: mwmaurer@mtu.edu (Mark Maurer)
Subject: Re: decimal arithmetic
Message-Id: <6l812l$ora$1@pace1.cts.mtu.edu>

Larry Rosler (lr@hpl.hp.com) wrote:
: > On Thu, 4 Jun 1998, Bob Trieger wrote:
: > 
: > > dgwilson@gte.net (Douglas Wilson) wrote:
: > > -> if (($val1+$val2)==$val3) {
: > > 
: > > Try evaluating $val1 + $val2 in your if statement and it should work.
: > > IE:     if (eval($val1 + $val2) == $val3)  { ... }
: > 
: > No, eval does nothing to affect this. (Why would you think it would?) 
: > 
: > -- 
: > Tom Phoenix       Perl Training and Hacking       Esperanto
: > Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
: 
: my $val1 = 119.98;
: my $val2 =  21.00;
: my $val3 = 139.98;
: printf  "%.20f\n", $val1 + $val2;       # 139.98000000000002000000
: printf  "%.20f\n", eval($val1 + $val2); # 139.97999999999999000000
: printf  "%.20f\n", $val3;               # 139.97999999999999000000
: 
: Why does it??

Hmm... Your values are off here.  119+21 = 140, so your first two values are
off by 1... :)

but seriously, I ran those lines of code on my linux box here, and didn't
quite get those values (excluding the off by 1 values...): 

citadel:/home/markm > ./trial.pl 
140.98000000000001818989
140.97999999999998976818
139.97999999999998976818

I'm probably off a bit here (maybe an undrstatement), but the variation could
be due to the value being returned by eval.  If this is the case, it shows
even more that floating point values are "finicky" and can be different just
because the wind is blowing north that day...  

Certainly, even if eval does change the value a little bit, there is no bet
that it will be a constant change...

enough of my ramblings...

-- 
Mark Maurer  markm@dct.com                      mwmaurer@mtu.edu
Programmer,  Digital Magic Interactive          http://www.dminteractive.com
Senior,      Michigan Technological University  Houghton, MI
-- Views do not represent those of my employer or school


------------------------------

Date: Fri, 05 Jun 1998 08:59:00 GMT
From: stuart@ilanet.slnsw.gov.au
Subject: Help ! setup noecho connection
Message-Id: <6l8c0j$4ds$1@nnrp1.dejanews.com>

hi all,

Does any know how to set noecho on a socket connection. I needed to ask
user password but i want the password to be hidden.


Thanks in advances.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Fri, 05 Jun 1998 10:30:40 GMT
From: adntaylor@my-dejanews.com
Subject: How do I get text counter perl script to work???
Message-Id: <6l8hcg$c4g$1@nnrp1.dejanews.com>

I'm trying to set up our website on a different site. It doesn't have a count
cgi script. Someone recommended a perl script written by Matt Wright that
does a text counter. I'm trying to get it working locally on our NT server
before putting it online. I've downloaded the Win32 Perl compiler and a
debugger.

I still can't get it to work.

What's going on?

What the hell is a URI?

Mum, where DO babies com from? (ignore this line if you have no sense of
humour)

Oh, I'm using these lines in the HTML:

<!--exec cgi="/counter.pl"-->
<!--#include virtual="/counter.pl"-->

Please help me - I'm desperate!

Alex Taylor
Densitron Computers - yes I'm hardware not software and shouldn't be doing
this - still, that's life.
mailto:adntaylor@bigfoot.com




-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Fri, 05 Jun 1998 08:42:20 GMT
From: Shaun Jackman <sjackman@rogers.wave.ca>
Subject: How do I prevent a socket from closing?
Message-Id: <3577AFA3.8E68C6D7@rogers.wave.ca>

I have a Perl script that connects to a socket.
What I want it to do is 

read as much information that comes in
display it to the screen
get one line of input from the user
send that to the socket
loop back to the start

the best I could come up with was
read one line from the socket
display one line
get one line of input from the user
send that to the socket
loop back to the start

The problem I'm having, is if no info came from the socket, I simply
want the program to display an empty line (or nothing), and then
continue (ask user for more input, send, receive response, display...)

What happens instead, is the program stops responding, if an empty line
ever comes in.

After the socket initiation section, the script is ---

while(<S>) {
  print "<--<";
  print;
  print ">-->";
  print S <stdin>;
}

If you can show me how to:
Get all the data from the remote-host, not just one line, and
How to stop the socket from closing on an empty line,
I would be appreciate it greatly.


Thanks for you time,
Please respond by e-mail as well if possible,
Shaun Jackman
sjackman@home.com


------------------------------

Date: Fri, 05 Jun 1998 05:51:55 GMT
From: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: How do you identify the OS
Message-Id: <3577854b.4260397@news.demon.co.uk>

Is there a method that exists that can be called from Perl which can
detect which OS is running?

There is a chunk of code at the start of CGI.pm which does this and I
have copied it into a procedure (see below), but Perl doesn't seem to
like the code inside a procedure declaration. It works fine in the
main body of the program.

Any thoughts ?

# -----
proc os
# -----
{
unless ($OS) {
    unless ($OS = $^O) {
	require Config;
	$OS = $Config::Config{'osname'};
    }
}
if ($OS=~/Win/i) {
    $OS = 'WINDOWS';
} elsif ($OS=~/vms/i) {
    $OS = 'VMS';
} elsif ($OS=~/^MacOS$/i) {
    $OS = 'MACINTOSH';
} elsif ($OS=~/os2/i) {
    $OS = 'OS2';
} else {
    $OS = 'UNIX';
}
	return $OS;
}
 


------------------------------

Date: Fri, 05 Jun 1998 08:59:47 +0300
From: Bekman Stanislav <sbekman@iil.intel.com>
Subject: Re: Module Net::SMTP
Message-Id: <35778953.446B@iil.intel.com>

Justin Archie wrote:
> 
> Could someone explain how to use the module known as Net::SMTP?
> 
> Justin Archie

http://www.esafe.com/stas/TULARC/works/scripts/mail-lib.txt 


______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com http://www.eprotect.com/stas  
Visit: http://www.eprotect.com/stas/TULARC (Perl,CGI,Linux,Web,Java,PC)
Linux receives a 'Product of the Year Award' for Best Technical Support
http://www.infoworld.com/cgi-bin/displayTC.pl?97poy.supp.htm


------------------------------

Date: Fri, 05 Jun 1998 12:22:40 +0200
From: Johan Priwshy <Centollo@iname.com>
Subject: numeric $value to string
Message-Id: <3577C6EE.1E8FCBB3@iname.com>

Hi there. I'd like to convert a numeric variable to string.
I had listened perl treats the variables as strings or as
numbers depending on the context you're using them, thus
making no conversions necesary.

The problem is I want a string containing some other joined
strings, ending with some random numbers.
I use the substr function to take only the not integer part
of a random number generated with rand ().

For example, rand (1) returns something as 0.2535464646 and
I'd like not to take the first two characters:

 $nmbr = rand(1);
 substr($nmbr, 0, 2)= "";

but THIS do not work! Can something explain me how to do this??

TIA

 CN.



------------------------------

Date: Fri, 05 Jun 1998 09:39:36 +0100
From: Iqbal gandham <iqbal@somewhere.com>
Subject: Re: pattern match
Message-Id: <3577AEC8.EACAA296@somewhere.com>

Tad McClellan wrote:
[snip]
> [
>   I wonder why
> 
>      W1A*,  W1E*,  W1H*,  W1M*,  W1N*,  W1P*,  W1R*, W1V*,  W1X*,  W1Y*
> 
>   are even put in the list, since anything that would match them
>   would also be matched by the 'W1*' pattern...
> 
> ]
[snip]

But the problem with this scenario is that it would also match W1B which
I dont want it to.

Iqbal


------------------------------

Date: Fri, 05 Jun 1998 09:40:55 +0100
From: Iqbal gandham <iqbal@somewhere.com>
Subject: Re: pattern match
Message-Id: <3577AF17.15AA62E0@somewhere.com>

Sorry I meant NW8* instead of SW8*

Iqbal

John Porter wrote:
> 
> Iqbal gandham wrote:
> >
> >
> > NW1*,  NW8*,  SE1,  SE11,  SE17,  SE5,  SW1,  SW10,  SW11,  SW1A,
> > SW1E,  SW1H,  SW1P,  SW1V,  SW1W,  SW1X,  SW1Y,  SW3,  SW4,  SW5,  SW6,
> > SW7,  SW8,  W1*,  W1A*,  W1E*,  W1H*,  W1M*,  W1N*,  W1P*,  W1R*,
> > W1V*,  W1X*,  W1Y*,  W2*,  W8*,  W9*;D5482.htm
> >
> > Firstly how do I either match on teh first three or four chracters,
> > cause as you can see some like SW8 only have 3 charcaters in it, so if
> > someone enters SW83 2ER, I need that to match just as if someone entered
> > SW1V 2ER.
> 
> Umm, are you sure that "SW83 2ER" should be matched by "SW8"?
> If so, then what's the difference between "SW8" and "SW8*"?
> 
> Thanks,
> John Porter
> (my email is down temporarily)


------------------------------

Date: Fri, 05 Jun 1998 09:41:02 +0100
From: Iqbal gandham <iqbal@somewhere.com>
Subject: Re: pattern match
Message-Id: <3577AF1E.3F758284@somewhere.com>

Sorry I meant NW8* instead of SW8*

Iqbal

John Porter wrote:
> 
> Iqbal gandham wrote:
> >
> >
> > NW1*,  NW8*,  SE1,  SE11,  SE17,  SE5,  SW1,  SW10,  SW11,  SW1A,
> > SW1E,  SW1H,  SW1P,  SW1V,  SW1W,  SW1X,  SW1Y,  SW3,  SW4,  SW5,  SW6,
> > SW7,  SW8,  W1*,  W1A*,  W1E*,  W1H*,  W1M*,  W1N*,  W1P*,  W1R*,
> > W1V*,  W1X*,  W1Y*,  W2*,  W8*,  W9*;D5482.htm
> >
> > Firstly how do I either match on teh first three or four chracters,
> > cause as you can see some like SW8 only have 3 charcaters in it, so if
> > someone enters SW83 2ER, I need that to match just as if someone entered
> > SW1V 2ER.
> 
> Umm, are you sure that "SW83 2ER" should be matched by "SW8"?
> If so, then what's the difference between "SW8" and "SW8*"?
> 
> Thanks,
> John Porter
> (my email is down temporarily)


------------------------------

Date: Fri, 05 Jun 1998 09:34:44 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Perl and Javascript conflicts
Message-Id: <3577ADA3.CE5704DD@nortel.co.uk>

Kushal Khan wrote:

>    ....  It seems, however, in these
> situations that the JavaScript should call the script that the Perl script
> "overrides" it and ignores the JavaScript's window.location.pathname
> reassignment. ...

I don't understand what you are trying to do...

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





------------------------------

Date: Fri, 05 Jun 1998 09:06:26 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: problem using LWP
Message-Id: <3576ff03.39980346@news.btinternet.com>

On Thu, 04 Jun 1998 19:42:06 GMT, sylviamo@my-dejanews.com wrote :

>Hello,
>I'm a real beginner with using perl modules, so I may be missing something
>really obvious.  I would also really appreciate a pointer to some really
>basic information on using modules in perl.  Here's my question:
>
>I'm using NT, the Gurusamy Sarathy port of Perl. I'm trying to use LWP simple.
>
>I run this, which I got directly from somebody's post here
>
>D:\Projects\Tiger>perl -MLWP::Simple -e 'getprint "http://www.sn.no"'
>
>...and get this error:
>
>Can't find string terminator "'" anywhere before EOF at -e line 1.
>

Hmm, better check those quotes.
 
>I tried this:
>
># test LWP simpleuse LWP::Simple;
>$content = get("http://biz.yahoo.com/news/biotechnology.html");print $content;
>...and it just hangs.
>
>Don't I need to tell it somewhere how to connect to the internet?  I'm using
>a proxy server--to I need to tell it to use that somewhere?
>

Yup you need to tell LWP about the Poxy er Proxy server.

If you use LWP::UserAgent you can specify a proxy as part of the
object before you frame your request. thus:


use LWP::UserAgent;

$our_proxy = 'http://it3.hastings.gov.uk';
$ua = new LWP::UserAgent;
$ua->proxy(['http', 'ftp'] => $our_proxy);

$the_query =
'http://search.open.gov.uk/cgi-bin/fx?DB=ccta&P=hastings&MAXHITS=1000&TOPDOC=0&FIND=1';

my ($progname, $progpath,$progext) =fileparse($0,".pl");

$req = new HTTP::Request ( 'GET',$the_query);

$res = $ua->request($req);


And so on and so forth

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



------------------------------

Date: Thu, 4 Jun 1998 15:30:29 -0700
From: youth philharmonic <mhickey@reed.edu>
Subject: problems compiling perl 5.004_04 in mklinux
Message-Id: <Pine.OSF.3.96.980604152901.27828A-100000@amon.reed.edu>

I am having trouble getting perl to compile on my mklinux system.  It
completes the make without much trouble, but the make test fails in the
following manner:
_________________________

lib/searchdict....ok
lib/selectsaver...ok
lib/socket........Can't load '../lib/auto/Socket/Socket.so' for module
Socket: ../lib/auto/Socket/Socket.so: undefined symbol: Perl_markstack_ptr
at ../lib/DynaLoader.pm line 166.

 at ./lib/socket.t line 14
BEGIN failed--compilation aborted at ./lib/socket.t line 14.
FAILED at test 0
lib/soundex.......ok
lib/symbol........ok
lib/texttabs......ok
lib/textwrap......ok
lib/timelocal.....ok
lib/trig..........ok
Failed 24 test scripts out of 153, 83.66% okay.
   ### Since not all tests were successful, you may want to run some
   ### of them individually and examine any diagnostic messages they
   ### produce.  See the INSTALL document's section on "make test".
   ###
   ### Since most tests were successful, you have a good chance to
   ### get information with better granularity by running
   ###     ./perl harness
   ### in directory ./t.
u=3.24  s=3.23  cu=149.4  cs=88.49  scripts=130  tests=4346
make: *** [test] Error 1
[root@polyester perl5.004_04]# t/perl t/harness
Can't load '../lib/auto/IO/IO.so' for module IO: ../lib/auto/IO/IO.so:
undefined symbol: Perl_markstack_ptr at ../lib/DynaLoader.pm line 166.

 at ../lib/IO/Handle.pm line 248
BEGIN failed--compilation aborted at ../lib/IO/Seekable.pm line 50.
BEGIN failed--compilation aborted at ../lib/IO/File.pm line 111.
BEGIN failed--compilation aborted at ../lib/Test/Harness.pm line 7.
BEGIN failed--compilation aborted at t/harness line 12.

_______________________

It appears to have problems with 'Perl_markstack_ptr'
Any ideas what is causing this? 

danke




------------------------------

Date: 05 Jun 1998 02:36:12 -0700
From: Xah Lee <xah@shell13.ba.best.com>
Subject: Q: apply func to mutate list; oneliner
Message-Id: <yo33edkyyur.fsf@shell13.ba.best.com>



Suppose I have a list from split(...), then I want to apply a function to the second element, then return the list. How to do it in one line?

Here's an *example*, where I'm using a @temp temporary array to achieve what I want.

#!perl -w
use strict;

my $line='1998/Mar/01';
my @temp; # I want to avoid this.

sub monthNameToNumber {return '03'};

@temp= split(m(/), $line);
$temp[1]= monthNameToNumber($temp[1]);
$line = join ('.',@temp);

--
(note that the above is only an EXAMPLE illustrating my question. It isn't what I am doing.)

Thanks for hints.

 Xah
 xah@best.com
 http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html
 Mountain View, CA, USA


------------------------------

Date: 05 Jun 1998 03:06:17 -0700
From: Xah Lee <xah@shell13.ba.best.com>
Subject: Q: dispatch find/replace string
Message-Id: <yo3zpfsxiw6.fsf@shell13.ba.best.com>


What's an efficient way of doing find and replace with a large "find/replace" lookup table?

An example:
 
 my $str = '1992 feb 1 kim';
 my %largeFindandRelpaceTable = ('jan'=>1,'feb'=>2,...);
 my $desiredResult = '1992 2 1 kim';
 
Thanks.

 Xah
 xah@best.com
 http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html
 Mountain View, CA, USA


------------------------------

Date: 5 Jun 1998 06:48:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Server Redirection
Message-Id: <6l84bl$oig$1@comdyn.comdyn.com.au>

In article <35776af4.12636688@news.cyberway.com.sg>,
	chuaby@hotmail.com (Chua Boon Yiang) writes:

> My objective is to delete all items in my shopping cart stored in the
> cookie then show the first page on my shopping mall. But the
> redirection doesn't work if the print "Set-Cookie: $_;
> expires=$expires; path=$cookie_path;\n"; is there.

And what exactly does this have to do with perl?

Go to one of the comp.infosystems.www.* groups, and ask there what you
are allowed to send as headers when the Location: header is present.
It's a HTTP issue, nothing to do with perl.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


------------------------------

Date: Wed, 03 Jun 1998 21:12:50 +0000
From: Brandon George <brandon@gcn.ou.edu>
Subject: shadowed password
Message-Id: <3575BC52.FC60036C@gcn.ou.edu>

I bet this has come up before.  I'm wanting to enter a password to a
perl script have it echo *'s as it's typed.  Is there a way of doing
this without externally messing with stty?

TIA,

-brandon

-- 
Brandon George
Systems Administrator
OU Dept. of Geography
brandon@gcn.ou.edu


------------------------------

Date: Fri, 05 Jun 1998 11:40:09 +0200
From: Patrick Erler <perler@dresden-online.com>
Subject: tool to cut the attachements from netscape-mailfiles
Message-Id: <3577BCF9.EACBB2DE@dresden-online.com>

Hi! 

Just wrote a little hack to eliminate the zips from my 80meg 
sent-file in netscapes mailfolder... it seems to work ;-) but only 
with base64-content (i.e. zips), not with tifs, pdfs etc. enough 
for me... 

PAT 

p.s. this hack is definitely not the art of perl, if someone would 
like to send me some suggestions how to optimize this script, he's 
welcome... 

---cut---
#!perl
#
#base64cut.pl
#hacked by pat erler (perler@dresden-online.com)
#
#writes all base64-content to filename.content, the rest to filename.msg
#
#be careful, backup, it's just a hack!
#
open (MIMEFILE,@ARGV [0]) || die "SYNTAX: mimecut filename\n";
open (MIME_CONTENT, ">@ARGV[0]".".content") || die "cannot create
content-file\n";
open (REST_OF_MSG, ">@ARGV[0]".".msg") || die "cannot create msg
file\n";

$base64 = 0;
$filename = 0;

print "base64cut is working on ".@ARGV[0]." and writes all
base64-content to\n";
print @ARGV[0].".content, the rest to ".@ARGV[0].".msg\n\n";

print "I hope you was careful and did a backup... %-}\n";


START: while (<MIMEFILE>) 
{
 chop ($_);
	if ($base64 ne 0 and $filename ne 0) 
		{
			until (/--/) 
			{
				print MIME_CONTENT "$_\n";
				next START;
			}
				$base64 = 0;
				$filename = 0;	
				next START;
		}
		else 
		{
			print REST_OF_MSG "$_\n";
			if (m/^Content-Transfer-Encoding: base64/i) 
			{
				$base64 = 1;
			}
			if (m/^Content-Disposition:/i) 
			{
				$filename =1;
			}
		}
}

close (MIME_CONTENT);
close (REST_OF_MSG);
close (MIMEFILE);


--cut---

-- 


= Contact ==
=	
= e-mail: perler@dresden-online.com
= ICQ: 6097076
=	
= Contact ==



------------------------------

Date: Fri, 05 Jun 1998 02:49:00 -0400
From: Mr James <71022.3700@CompuServe.COM>
Subject: Re: Why is there no "in" operator in Perl?
Message-Id: <uwtMG4Ek9GA.337@nih2naab.prod2.compuserve.com>

>You'll get a raise, and in no time flat be on a sunny beach in Hawaii
>                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>enjoying you decision to read the perl faq.

Like me right now!
-- 
Mr. James,CP-ASEL-IA,PP-AMEL,Internet Consultant,71022.3700@compuserve.com


------------------------------

Date: Fri, 5 Jun 1998 08:25:35 GMT
From: David Cross-cmt <Dave.Cross@gb.swissbank.com>
Subject: Re: Why is there no "in" operator in Perl?
Message-Id: <eq090nc9rwg.fsf@gb.swissbank.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

> You are missing having read the find perlfaq4 manpage, included on your
> very system, which answers this is gorious detail. 
                                     ^^^^^^^

I take it that 'gorious' is halfway betwen 'glorious' and 'gory'.
Or was it just a serendipitous typo?

Dave...

-- 
If I wasn't so busy writing status reports,
my status report might just become a progress report.

Dave.Cross@gb.swissbank.com


------------------------------

Date: 5 Jun 1998 10:42:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why is there no "in" operator in Perl?
Message-Id: <6l8i2a$cs7$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    David Cross-cmt <Dave.Cross@gb.swissbank.com> writes:
:> very system, which answers this is gorious detail. 
:                                     ^^^^^^^
:Or was it just a serendipitous typo?

Nope.

--tom
-- 
Besides, including <std_ice_cubes.h> is a fatal error on machines that
don't have it yet.  Bad language design, there...  :-)
        --Larry Wall in <1991Aug22.220929.6857@netlabs.com>


------------------------------

Date: Fri, 05 Jun 1998 09:43:58 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Yes, it is
Message-Id: <3577AFCD.33233F90@nortel.co.uk>

But then I have a lot of these messages on newgruops I help out ->

Martien Verbruggen wrote:

> Wait a second... Could I have some of those mushrooms you're eating?
> Please?

HAHAHA, YES!!! :)

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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 2814
**************************************

home help back first fref pref prev next nref lref last post