[12322] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5922 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 8 14:07:20 1999

Date: Tue, 8 Jun 99 11:00:21 -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           Tue, 8 Jun 1999     Volume: 8 Number: 5922

Today's topics:
        Annonymous hash in C base class <benny@alben.com>
    Re: can i variably name an array? (Kvan)
    Re: Choosing a time module and working with it (Malcolm Ray)
    Re: Choosing a time module and working with it (Larry Rosler)
        Current Directory Name <donsimon@bellsouth.net>
        fork for DNS lookup - help <delete.the.nospam.kayec@gov.ns.ca>
    Re: Get Date in Perl <uri@sysarch.com>
    Re: if loop ? <rootbeer@redcat.com>
        Interesting Update <technology@workmail.com>
        Interesting Update <technology@workmail.com>
    Re: Interesting Update (Malcolm Ray)
    Re: Interesting Update <rootbeer@redcat.com>
        m4 to perl ?! <anfi@bigfoot.com>
        NET::Domain NET::SMTP (Brian Pontz)
    Re: Perl "constructors" <emschwar@rmi.net>
    Re: Perl cgi problem: use cgi qw()param; unrecognized s <perlguy@technologist.com>
        Perl on win32 <ken_flannigan@studio.disney.com>
        Perl Sucks! <jeromeo@atrieva.com>
    Re: PERL/CGI mystere ? <rootbeer@redcat.com>
    Re: Q: a simple search and replace (Kevin D. Clark)
    Re: Q: a simple search and replace (Larry Rosler)
    Re: Q: a simple search and replace <ludlow@us.ibm.com>
        Q: Training in UK for DBI/CGI/Apache Perl stuff <cc047@ecs.pc.cranfield.ac.uk>
    Re: reading socket problem <rootbeer@redcat.com>
        Regular Expresion <tlynch@cisco.com>
    Re: Return value of -die- <rootbeer@redcat.com>
    Re: run .bat using WIN 32 perl <dominikl@pyramid.de>
    Re: Using a hash slice with references? (Larry Rosler)
    Re: Using a hash slice with references? (John Klassa)
    Re: Using Perl over server, Help <perlguy@technologist.com>
    Re: Using string variable as name of subroutine to call <uri@sysarch.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 8 Jun 1999 12:23:36 -0400
From: "me" <benny@alben.com>
Subject: Annonymous hash in C base class
Message-Id: <7jjg2d$4ue$1@news.spacelab.net>

How can I make the base class created as a wrapper for a C++ class, contain
also an
annonymous hash? When I create my subclass I cannot use a hash in a
subclass.
I created an FDF class (it works fine). Then I subclass it as follows:

----------------------------------------------------------
@ISA        = qw(FDF);
sub new {
    my ($class) = @_;
    my ($self) = FDF->new();
    bless ($self, $class);

    $self->{'CGIVARS'}     = "";
    return $self;
}
I get the message: "Not a HASH reference at ..." in the line that sets
$self->{'CGIVARS'}
If I set $self to {} I get the message that I cannot access FDF because
$self is not blessed (which makes sense).
---------------------------------------------------------------
I created the FDF class using a .xs file as follows:
FDFConn *
FDFConn::new(...)

    CODE:
    if (items == 2) {
        RETVAL = new FDFConn((const char*)SvPV(ST(1),na));
    } else if (items == 1) {
        RETVAL = new FDFConn();
    } else {
        croak("Usage: FDF::new(CLASS [, source])");
    }
    sv_setref_pv(ST(0), CLASS, RETVAL);
    OUTPUT:
    RETVAL

Any ideas?
Thanks
Benny




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

Date: Tue, 08 Jun 1999 17:08:20 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: can i variably name an array?
Message-Id: <375d4c52.555130014@news.newsguy.com>

On Tue, 08 Jun 1999 13:12:12 GMT, mikecard@my-deja.com wrote:

>is it possible to give an array an interpolated name?

Yes, but be very sure that you want to. A hash of arrays is a much
better, more scalable and general solution:

$arrayname = "My array";

Setting values:
$arrays{$arrayname}[0] = "Foo";

Getting values:
$result = $arrays{"My array"}[0];

For more info:

perldoc perldsc
perldoc perllol

Kvan.
-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- |  dumb, panicky, dangerous animals
                                 |  and you know it.'
                                 |        - "K" in Men in Black.


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

Date: 8 Jun 1999 16:01:09 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Choosing a time module and working with it
Message-Id: <slrn7lqfi5.6ji.M.Ray@carlova.ulcc.ac.uk>

On Tue, 8 Jun 1999 12:13:13 +0100, James Stewart <james@britlinks.co.uk> wrote:
>I need $when to contain the date on which the script is run. I used the
>following code ... is there a better way of getting the four digit year
>than simply tagging on "19"?
>
>(,,,$mday,$mon,$year,,,)=localtime(time);
>$year = "19".$year ;
>my $today = $year.$mon.$mday;

perldoc -f localtime
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 8 Jun 1999 10:15:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Choosing a time module and working with it
Message-Id: <MPG.11c6ef7ad5c72b61989b96@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <ant0811130b0Lh==@ch0128.charis.co.uk> on Tue, 8 Jun 1999 
12:13:13 +0100, James Stewart <james@britlinks.co.uk> says...
 ...
> (,,,$mday,$mon,$year,,,)=localtime(time);
> $year = "19".$year ;
> my $today = $year.$mon.$mday;

There are three errors in the above code, one of which won't be apparent 
for some months, one of which will get you right now, and one of which 
will cause the comparison test below to fail because of a formatting 
problem.
 
> The array @final includes the following entries:
> 
> @final[0][0] 04/06/1999
> @final[1][0] 08/06/1999
> @final[2][0] 16/06/1999
> 
> and running it yesterday (08/06/1999) I said:
> 
> my @new = grep $_->[0] =~ m%(\d\d)/(\d\d)/(\d{4})% && "$3$2$1" ge $today, @final;

Did you try printing the value of $today?

perldoc -f localtime
perldoc -f sprintf

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 8 Jun 1999 12:25:04 -0500
From: "Donny Simonton" <donsimon@bellsouth.net>
Subject: Current Directory Name
Message-Id: <kqc73.5987$By5.542@news4.mia>

What's the easiest way to get the current directory name, but not the path.

For example, if you are in the PROGRAMS directory, I need to get just the
name of the directory, and not /home/sites/blabla/programs.

Any suggestions?
Donny




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

Date: Tue, 8 Jun 1999 14:51:42 -0300
From: "kayec" <delete.the.nospam.kayec@gov.ns.ca>
Subject: fork for DNS lookup - help
Message-Id: <gKc73.490$aP5.29264@sapphire.mtt.net>

To speed up DNS lookups i've split my list of IPs into 5 different files.
Now i want to span five PERL programs to do the lookups.
After the lookups are done i have to do more processing so i need to know
when the five processes are done.

I think i want to use FORK for this but am not clear on the syntax....

HELP PLEASE !




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

Date: 08 Jun 1999 13:50:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Get Date in Perl
Message-Id: <x7674y7f9h.fsf@home.sysarch.com>

>>>>> "ot" == outlaw torn <outlaw_torn@mailexcite.com> writes:

  ot> In article <1dt1ul7.4nps5l1iifx22N@p67.block2.tc1.state.ma.tiac.com>,
  ot>   rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:

  >> "I don't have the documentation with me, so I'm going to post a
  ot> bullshit

  >> answer that will undoubtedly mislead the innocent newbie looking for
  >> help, and the rest of you assholes better not give me a hard time
  ot> about
  >> it."

  ot> Yeah ... that my intention (I hope you understand sarcasm better than
  ot> uri)

  ot> But NOOOO...lets be patronising because I've been at this ng forever,
  ot> blah blah blah....

oooooooh! i have been hurt to the bone. such wit, wisdom and eloquence
has won me over to your myopic point of view. you have made me swear off
ever answering a usenet post again, especially here where i have been
posting ever since the beginning of usenet in 1934. and i will never
correct you or any other wrong posts again as it is better to leave
fixing those mistakes as an exercise to the newbie. how else will they
learn how to program perl poorly? (say perl poorly 3 times fast and you
will show what you know).

BTW that was sarcasm, not the vulgar, childish rant of someone who
hasn't yet faced real world criticism in their pitiful little life. wait
until you get out of grade school and face some real heat. your cursing
will win you many punches in your psychic guts. i hope you have fun
puking out your heart in every public place you into which you ever show
your pimply face.

how's that for some insults? no cursing (which i reserve for very big
schmucks like bottommind. you aren't worth being that angry about.). i am
laughing at you as is the rest of this group. even the newbies can tell
what is useful and baldersdash here.

as for answering the original post, others did it correctly answer it so
i didn't followup. but seeing your blatantly wrong and assinine comment
about printing out the values os localtime and figuring it out was the
straw. it was one of the most insulting and useless posts here in a long
time. your comment on not having the docs was a close second. if you
don't have them and are not sure, then you could have browsed them at
www.perl.com to verify your misbegotten thought.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 8 Jun 1999 10:34:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: if loop ?
Message-Id: <Pine.GSO.4.02A.9906081033050.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Mark Stellaard wrote:

> when I use a simple piece of code like e.g.
> 
> if ($tmp_arg eq "-a"){
>     push (@array, $foo);
>     push (@array1, $bar);
> }
> 
> it only executes the first push statement? after the if loop. Why
> doesn't the second push statement work? can anybody please tell me?

Did you mean to use @array and @array1 both? Maybe -w would help.

Could you please make a small (five or ten lines) self-contained program
which demonstrates the problem you're having? Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 08 Jun 1999 09:29:05 -0700
From: Raj <technology@workmail.com>
Subject: Interesting Update
Message-Id: <375D44D1.BBF7259@workmail.com>

* My CGI/Perl script shoud update a textfile eliminating
duplicate rows(lines)
* I'm trying to delete an "a.ext" file thru the system command
System("rm $filename.ext");
from within my script.
but the file is not getting deleted. Any clue?

Thanx in Advance.
Regards,
Raj
technology@workmail.com



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

Date: Tue, 08 Jun 1999 09:31:17 -0700
From: Raj <technology@workmail.com>
Subject: Interesting Update
Message-Id: <375D4555.7ADFC923@workmail.com>

* My CGI/Perl script shoud update a textfile eliminating
duplicate rows(lines)
* I'm trying to delete an "a.ext" file thru the system command
System("rm $filename.ext");
from within my script.
but the file is not getting deleted. Any clue?

Thanx in Advance.
Regards,
Raj
technology@workmail.com



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

Date: 8 Jun 1999 16:43:49 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Interesting Update
Message-Id: <slrn7lqi25.6om.M.Ray@carlova.ulcc.ac.uk>

On Tue, 08 Jun 1999 09:29:05 -0700, Raj <technology@workmail.com> wrote:
>* My CGI/Perl script shoud update a textfile eliminating
>duplicate rows(lines)

See the FAQ:
perldoc perlfaq5
"How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?"

>* I'm trying to delete an "a.ext" file thru the system command
>System("rm $filename.ext");
>from within my script.
>but the file is not getting deleted. Any clue?

That's not a great way to do it - it's inefficient and non-portable.
Use perl's unlink function, and let perl itself tell you what's wrong:

unlink("$filename.ext") or die "Error removing $filename.ext: $!"
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 8 Jun 1999 10:39:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Interesting Update
Message-Id: <Pine.GSO.4.02A.9906081038190.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Raj wrote:

> * I'm trying to delete an "a.ext" file thru the system command
> System("rm $filename.ext");
> from within my script.
> but the file is not getting deleted. Any clue?

Try using unlink() from within Perl, and check its return value. If it
fails, examining $! should reveal a useful and informative reason. Good
luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 08 Jun 1999 18:13:08 +0200
From: Andrzej Filip <anfi@bigfoot.com>
Subject: m4 to perl ?!
Message-Id: <375D4114.A30CD4F3@bigfoot.com>

Do you know any program/script which converts m4 files
(m4 - preprocessor used by sendmail configuration)
to perl scripts ?

--
Andrzej (Andrew) A. Filip
http://www.bigfoot.com/~anfi
E-mail: anfi@bigfoot.com
I NO LONGER USE anfi@polbox.com
Posting history (all addresses):
http://www.dejanews.com/profile.xp?author=Andrzej%20Filip&ST=PS




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

Date: Tue, 08 Jun 1999 17:13:29 GMT
From: pontz@channel1.com (Brian Pontz)
Subject: NET::Domain NET::SMTP
Message-Id: <375d4ea9.79844971@news2.channel1.com>

Hello,
I need the NET::Domain and NET::SMTP modules. I've looked around on
cpan.org and they didnt have it. I also tried searching the web and
was unable to find it as well. Anyone know where I can get these
modules ? I need them for Mail::Tools

Thanks
Brian Pontz



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

Date: 08 Jun 1999 10:52:50 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Perl "constructors"
Message-Id: <xkfg142my71.fsf@valdemar.col.hp.com>

armchair@my-deja.com writes:
> That is an error, absolutely. Int pointers should not point to Foo
> classes or structs, and that pointer should not later be dereferenced.
> By the way, how did you come out on getting my code to compile. I will
> repeat it again here:
> 
> int *a;
> short b = 2;
> a = &b;

Compiles just fine in K&R mode.  ANSI mode generates a warning:

cc: "/tmp/tmp.c", line 5: warning 604: Pointers are not assignment-compatible.

But it compiles and generates a valid executable.

Perhaps you should pick your examples more carefully?

-=Eric


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

Date: Tue, 08 Jun 1999 11:30:05 -0500
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Perl cgi problem: use cgi qw()param; unrecognized switch use CGI  qw(param);
Message-Id: <375D450D.74B0B21D@technologist.com>

Aaron,

"param" is not an option in CGI.pm, however, it IS a function.

CHeck out Lincoln's excellent documentation at:
http://stein.cshl.org/WWW/software/CGI/cgi_docs.html

You will be up and running in no time...

Brent


aaron@preation.com wrote:
> 
> My Web Server Tells me "Unrecognized switch:" in the error log when I run
> a script. It says the error is caused by the following line:
> 
> use CGI qw(param);
> 
> I only know to use this line to get the info from a form that was
> submitted. When I take it out, everything else works fine, just the
> values I am trying to pass don't come through. How else can I get the
> values through, what should I call to make this work?
> 
> Thanks for your help!
> 
> Aaron
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.


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

Date: Tue, 8 Jun 1999 10:13:52 -0700
From: "Ken Flannigan" <ken_flannigan@studio.disney.com>
Subject: Perl on win32
Message-Id: <7jjj00$e8u$1@louie.disney.com>

I am trying to set up my environment on my NT box at work for running Perl
scripts at the command line. In the Perl book I bought, there's a setting
for the pathext environment variable where you set it to
pathext=%pathext%;.plx

This works fine for the current dos box that's open. The problem is when you
close the dos box and then open a new dos session, the pathext is back to
the original setting.

Does anyone know how can I make this permanent?

Thanks in advance
ken.flannigan@disney.com





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

Date: Tue, 08 Jun 1999 10:07:33 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Perl Sucks!
Message-Id: <375D4DD5.C677FB24@atrieva.com>

Or at least gets a mention on Suck.  http://www.suck.com.

Thats big time!  ;->


-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Tue, 8 Jun 1999 10:36:27 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: PERL/CGI mystere ?
Message-Id: <Pine.GSO.4.02A.9906081036160.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Hotline smig wrote:

> But sometime the perl/cgi process don't want to close. ... ?? ...

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 08 Jun 1999 11:43:39 -0400
From: kclark@cabletron.com (Kevin D. Clark)
Subject: Re: Q: a simple search and replace
Message-Id: <k5iu8ysno4.fsf@cabletron.com>


milan andric <m-andric@students.uiuc.edu> writes:

> i'm having problems with a simple regular expression to globally 
> substitute a string in a file.
> 
> i'm trying:
> 
>       open (INDEXIN, ">>bond.html") || die "Can't open file: $!\n";

You've opened this file in "append" mode.

Generally speaking, this means that when you write to this filehandle,
you're actually placing stuff at the end of "bond.html".

>              while ($line=<INDEXIN>) {
>                         $line=~ s/<p><strong>/<p>/g;

If you only open a file for writing (as you have), you can't expect to 
read from this filehandle.

In addition, you're going to need a print statement somewhere in this
while loop.  Making a substitution and printing the result are two
different operations.

>                    }
>                     
>         close (INDEXIN);
> 
> this should simply do a global replace of all the instances of <p><strong>
> with <p>.  but it doesn't seem to do anything.  if i change the
> >>(append) to a > (write over) i end up with an empty file.
> 
> i don't get it

You should probably check out $^I and just use a "while (<>) { ... }"
loop.

--kevin
-- 
Kevin D. Clark (kclark@cabletron.com)          Give me a decent UNIX
Cabletron Systems, Inc.                      and I can move the world
Durham, N.H. (USA)


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

Date: Tue, 8 Jun 1999 10:22:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: a simple search and replace
Message-Id: <MPG.11c6f125850b3c4a989b97@nntp.hpl.hp.com>

In article <g0b73.2300$nn.709212@news.shore.net> on Tue, 08 Jun 1999 
15:53:48 GMT, Scratchie <upsetter@ziplink.net> says...
 ...
> However, if you're on Unix, there's a much much easier way to accomplish
> this:
> 
> 	#! /usr/bin/perl
> 	
> 	while (<>) {
> 		s/<p><strong>/<p>/g;
> 		print;
> 	}
> 
> You can then invoke this script like so:
> 	myscript myfile.html > myoutputfile.html
> 
> This allows you to run your script on any input file and redirect the
> output to any file you like. This is "the unix way" and it will save you
> a lot of work and hassle in the long run (if you're completely in the dark
> on how Unix does stuff like this, I suggest you pick up the O'Reilly "Unix
> in a Nutshell" book, a.k.a. "Unix for Smarties").

It is not "the unix way".  It is "the shell way".  It will work on any 
system that runs any reasonably modern (i.e., < 20 years old) command 
interpreter.  That includes DOS, Windows 3.1, Windows 95, Windows 98, 
and Windows NT.  It will also work on Windows 2000.  So far as I know, 
none of those is "unix".

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 08 Jun 1999 12:47:47 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Q: a simple search and replace
Message-Id: <375D5743.FB465D74@us.ibm.com>

milan andric wrote:

>       open (INDEXIN, ">>bond.html") || die "Can't open file: $!\n";
>              while ($line=<INDEXIN>) {
>                         $line=~ s/<p><strong>/<p>/g;
>                    }
> 
>         close (INDEXIN);
> 
> this should simply do a global replace of all the instances of <p><strong>
> with <p>.  but it doesn't seem to do anything.  if i change the
> >>(append) to a > (write over) i end up with an empty file.

That's because nowhere in your code do you actually write to the file. 
You need to open an output file and use something like:

print OUT $line;

You could also perform this operation from the command line with:

perl -wpi.bak -e 's/<p><strong>/<p>/g' bond.html

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Tue, 8 Jun 1999 17:50:46 +0100
From: Jeffrey Goldberg <cc047@ecs.pc.cranfield.ac.uk>
Subject: Q: Training in UK for DBI/CGI/Apache Perl stuff
Message-Id: <Pine.LNX.4.10.9906081746300.7088-100000@ccjpg2.ccc.cranfield.ac.uk>

I'm looking for good training courses in the UK for either Perl based or
PHP based Web database tools.

I've looked at the Perl/CGI FAQ and I've looked a the various links from
perl.com and perl.org, but didn't find anything in the UK.

Please copy me on responses (and then nag me to summerize).

Thanks,

-j

-- 
Jeffrey Goldberg                +44 (0)1234 750 111 x 2826
 Cranfield Computer Centre      FAX         751 814
 J.Goldberg@Cranfield.ac.uk     http://WWW.Cranfield.ac.uk/public/cc/cc047/
Relativism is the triumph of authority over truth, convention over justice.



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

Date: Tue, 8 Jun 1999 10:32:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: reading socket problem
Message-Id: <Pine.GSO.4.02A.9906081025530.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Alex wrote:

> This (example) script below should record browser requests.
> It's working fine with browsers what are sending
> 
> Headers\r\n
> \r\n
> Body \r\n
> (eq Netscape)
> 
> but not with browsers what are sending
> 
> Headers\r\n
> \r\n
> Body
> (without last \r\n)

Well, what does the spec say about the protocol? Make your program work
according to the spec, and complain to (or about!) any software author who
doesn't respect the spec.

But I'm not sure why you're not using a ready-debugged-and-waiting module
which implements the protocol you need. Are you reinventing the wheel?

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Tue, 08 Jun 1999 13:24:25 -0400
From: Tom Lynch <tlynch@cisco.com>
Subject: Regular Expresion
Message-Id: <375D51C9.646A68B5@cisco.com>

Greetings:

	I have the line:

	foo/foo_bar/foobar\[15\]/foo

	I need the line to look like:

	foo\/foo_bar\/foobar\[15\]/foo

	Note: the tailing /foo no longer contains
	a backslash. I've tried:

	 $_ =~ s#(/).*/.*$#\\/#;

	Mistakenly thinking the ancore would take
	care of the match.  Does anyone have a 
	regular expression which would work here?

	Thanks for any help in advance.

	Tom
-- 
#-----------------------+--------------------------+
# Tom Lynch             | Email: tlynch@cisco.com  |
# Cisco Systems         | Phone: 978-244-8765      | 
# 250 Apollo Drive      | FAX:   978-244-8039      |
# Chelmsford MA 01824   | MS:    CH1-2LF           |
#-----------------------+--------------------------+


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

Date: Tue, 8 Jun 1999 10:46:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Return value of -die-
Message-Id: <Pine.GSO.4.02A.9906081043520.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Ondrej Palkovsky wrote:

[ example code snipped ]

> The problem is, that the script shouldn't return the zero value, but
> something else(probably 1, that's what mt returns). Could you point
> me, where is the problem?

I think it's a bug which is fixed in 5.005_03, and perhaps earlier. Here's
what I find with a simpler test case:

    $ perl5.00404  -lwe '`false`; print $?; die' ; echo $?
    65280
    Died at -e line 1.
    0

    $ perl5.005_03  -lwe '`false`; print $?; die' ; echo $?
    65280
    Died at -e line 1.
    255

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 08 Jun 1999 17:42:20 +0200
From: Dominik Leinfelder <dominikl@pyramid.de>
Subject: Re: run .bat using WIN 32 perl
Message-Id: <375D39DC.2D74D9C1@pyramid.de>

nicolased@my-deja.com schrieb:

> I'm working with the Win 32 version of perl
> and I want tu run a .bat during my perl script
>
> I have tried the exec command
> but it works only with .exe
>
> Thanx,
> Nicolas
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Try system( ) - this will work with batchfiles on win32.
But also read in perfunc (is it the only one?) for details..
good luck!

greetinx
Dominik Leinfelder




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

Date: Tue, 8 Jun 1999 10:29:33 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Using a hash slice with references?
Message-Id: <MPG.11c6f2db453e2ed1989b98@nntp.hpl.hp.com>

In article <OTRr1Xcs#GA.296@cpmsnbbsa03> on Tue, 8 Jun 1999 11:50:11 -
0400, Dmitry P. <dpodbori@email.msn.com> says...
> According to The Camel Book, expression
> $a->{ $b, $c, $d }
> is interpreted by Perl as
> $a->{ join( $;, $b, $c, $d ) }
> 
> where $; is a special variable by default set to Ctl-BackSpace. This
> behavior allows to simulate multidimensional arrays

That is true, but totally irrelevant.  The questioner was asking about a 
hash slice, which is a list, not a scalar:

  @$a->{ $b, $c, $d }

or

  @{$a}{ $b, $c, $d }

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 8 Jun 1999 17:24:43 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: Using a hash slice with references?
Message-Id: <7jjjkr$hho$1@aurwww.aur.alcatel.com>

On 8 Jun 1999 09:05:47 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
  > In the general case, @$hashref{K1,K2,K3}.

Is there anyone else for whom this notation seems strange?  I'm not saying
it's incorrect; I'm just saying that it's not intuitive to me.  The whole
notion of:

	$$hashref{$key}

is weird, too.  I much prefer:

	$hashref->{$key}

because it makes the fact that $hashref is a reference more obvious.

To wit, if I say:

	@$hashref{$key1, $key2}

then later decide I should use a single element rather than a slice, my
inclination is to lop off the front and back (more or less):

	$hashref{$key1}

(i.e. simply remove the "@" and the second key).  However, at this point,
I've got problems because there is no hash named %hashref.

As I said, I understand what the notation is...  I'm just not sure *why* it
is, or why someone might think it's intuitive. :-)

-- 
John Klassa / Alcatel USA / Raleigh, NC, USA


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

Date: Tue, 08 Jun 1999 11:33:20 -0500
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Using Perl over server, Help
Message-Id: <375D45D0.59B89EBE@technologist.com>

Try :
#!/usr/local/bin/perl

instead of
#!!/user/local/bin/perl


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

Date: 08 Jun 1999 13:53:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Using string variable as name of subroutine to call
Message-Id: <x71zfm7f4p.fsf@home.sysarch.com>

>>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:

  GB> In article <7jj9tr$pvv$3@info2.uah.edu>,
  GB> 	gbacon@itsc.uah.edu (Greg Bacon) writes:
  GB> : In article <x73e0390q6.fsf@home.sysarch.com>,
  GB> : 	Uri Guttman <uri@sysarch.com> writes:
  GB> : : >>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
  GB> : :   TM>    Never use Symbolic references!
  GB> : : 
  GB> : : unless you really, really know what you are doing.
  GB> : 
  GB> : Please justify this statement.

  GB> Hmm.  After receiving a reply from Daniel Grisinger, I realized that
  GB> I parsed Uri's statment as "Tad's heuristic only applies when you
  GB> really, really know what you're doing".  Oops. :-)

write yourself a new parser!

i thought my addendum was clear. symrefs are evil and should only be
used by evil mad scientists in their darkest modular castles!

:-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

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

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