[15582] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2995 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 9 18:16:10 2000

Date: Tue, 9 May 2000 15:15:42 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <957910541-v9-i2995@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 9 May 2000     Volume: 9 Number: 2995

Today's topics:
    Re: Is Perl fast enough? <andy@u2me3.com>
    Re: Is Perl fast enough? (brian d foy)
    Re: Is Perl fast enough? <jeff@vpservices.com>
    Re: Is Perl fast enough? <rootbeer@redcat.com>
    Re: Is Perl fast enough? <lr@hpl.hp.com>
    Re: is there an easy way to use colours in stdout? <andy@u2me3.com>
    Re: is there an easy way to use colours in stdout? (R1CH)
    Re: is there an easy way to use colours in stdout? <lr@hpl.hp.com>
        Iterating an array question? aphiny6592@my-deja.com
        Iterating an array question? yin_12180@yahoo.com
    Re: Iterating an array question? <lr@hpl.hp.com>
        Multi-threading and perl nfin8axs@hotmail.com
    Re: Multi-threading and perl <dan@tuatha.sidhe.org>
        NetworkSolutions - example of lapse security <andy@u2me3.com>
        Newbie brain fade <rbbdsb@earthlink.net>
    Re: Newbie brain fade <mordecai@teleport.com>
    Re: Newbie brain fade <lr@hpl.hp.com>
    Re: Newbie brain fade <lr@hpl.hp.com>
    Re: Output user input to a plain text file <nospam@devnull.com>
    Re: Parallel port <christian.goebel@luxmail.lu>
    Re: Pattern Matching <lr@hpl.hp.com>
    Re: Pattern Matching <jeff@vpservices.com>
    Re: Perl code to check for broken links <nospam@devnull.com>
    Re: Perl code to check for broken links <nospam@devnull.com>
    Re: Perl code to check for broken links (brian d foy)
    Re: Perl code to check for broken links <lr@hpl.hp.com>
    Re: Perl code to check for broken links (Bart Lateur)
        printing to a winNT printer <alager@csuchico.edu>
    Re: semaphores under perl <cslewis@mobilecom.com>
    Re: signal trapper <rootbeer@redcat.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 9 May 2000 18:58:57 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: Is Perl fast enough?
Message-Id: <8f9jlc$2s0$1@plutonium.btinternet.com>

I'm developing an application in my spare time that plays around with ~15
million lines in half a dozen different files, and then plays with a mySQL
database. I have a system that works, but it's extremely memory intensive -
causing a stack overflow when I run it on the live files  :o(

No clue as to how I'm going to get this working efficiently  :o)


Thanks, Andy.
andy@u2me3.com




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

Date: Tue, 09 May 2000 14:42:05 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Is Perl fast enough?
Message-Id: <brian-ya02408000R0905001442050001@news.panix.com>

In article <8f9jlc$2s0$1@plutonium.btinternet.com>, "Andy Chantrill" <andy@u2me3.com> posted:

> I'm developing an application in my spare time that plays around with ~15
> million lines in half a dozen different files, and then plays with a mySQL
> database. I have a system that works, but it's extremely memory intensive -
> causing a stack overflow when I run it on the live files  :o(

use less memory :)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 09 May 2000 11:49:30 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Is Perl fast enough?
Message-Id: <39185DBA.386E9F63@vpservices.com>

Andy Chantrill wrote:
> 
> I'm developing an application in my spare time that plays around with ~15
> million lines in half a dozen different files, and then plays with a mySQL
> database. I have a system that works, but it's extremely memory intensive -
> causing a stack overflow when I run it on the live files  :o(

It all depends on how you are "playing around".  If you slurp either the
files or the database query-fetches into arrays or, worse, hashes, then
you got problems.  If instead you cycle through the files and the
query-fetches a record at a time, you should be able to get more mileage
out of that setup.  It's not the total number of lines that matters,
it's the total number you try to deal with simultaneously at any one
point in time.  Forgive me if I'm pointing out the obvious.

-- 
Jeff


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

Date: Tue, 9 May 2000 12:18:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is Perl fast enough?
Message-Id: <Pine.GSO.4.10.10005091217430.3921-100000@user2.teleport.com>

On Tue, 9 May 2000, brian d foy wrote:

> use less memory :)

    use less 'memory';		# :-)

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



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

Date: Tue, 9 May 2000 12:23:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Is Perl fast enough?
Message-Id: <MPG.1382057d220926d098aa35@nntp.hpl.hp.com>

In article <brian-ya02408000R0905001442050001@news.panix.com> on Tue, 09 
May 2000 14:42:05 -0400, brian d foy <brian@smithrenaud.com> says...
> In article <8f9jlc$2s0$1@plutonium.btinternet.com>, "Andy Chantrill" <andy@u2me3.com> posted:
> 
> > I'm developing an application in my spare time that plays around with ~15
> > million lines in half a dozen different files, and then plays with a mySQL
> > database. I have a system that works, but it's extremely memory intensive -
> > causing a stack overflow when I run it on the live files  :o(
> 
> use less memory :)

ITYM 'buy more memory' :-)

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


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

Date: Tue, 9 May 2000 20:04:20 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: is there an easy way to use colours in stdout?
Message-Id: <8f9nkh$d5p$1@uranium.btinternet.com>

Hey,

Personally, I'd use Term::ANSIColor. But check out CPAN, there's a few
modules that play around with terminal stuff ...


Thanks, Andy.
andy@u2me3.com




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

Date: Tue, 09 May 2000 20:09:11 GMT
From: r1ch@n0sp4m.r1ch.net (R1CH)
Subject: Re: is there an easy way to use colours in stdout?
Message-Id: <39186fb9.101755326@news.screaming.net>

On Tue, 09 May 2000 13:53:11 -0400, Tina Mueller <tina@streetmail.com>
wrote:

>hi,
>
>=head2 How do I print something out in color?
>
>    use Term::ANSIColor;
>    print color("red"), "Stop!\n", color("reset");
>    print color("green"), "Go!\n", color("reset");

[31mStop!
[0m?[32mGo!
[0m

There goes the cross platform compatibilty of my program :( - Trust
Microsoft not to have built in ANSI in Win2k command prompts. To enable
it you have to revert to using old DOS based command interpreter, and it
doesn't even work for programs, only command prompts. Sigh.

Thanks anyway, I can probably use this for some of my other *nix-only
programs.

R1CH.


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

Date: Tue, 9 May 2000 13:40:34 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: is there an easy way to use colours in stdout?
Message-Id: <MPG.138217a117841a3098aa39@nntp.hpl.hp.com>

In article <39186fb9.101755326@news.screaming.net> on Tue, 09 May 2000 
20:09:11 GMT, R1CH <r1ch@n0sp4m.r1ch.net> says...
> On Tue, 09 May 2000 13:53:11 -0400, Tina Mueller <tina@streetmail.com>
> wrote:

 ...

> >=head2 How do I print something out in color?
> >
> >    use Term::ANSIColor;
> >    print color("red"), "Stop!\n", color("reset");
> >    print color("green"), "Go!\n", color("reset");
> 
> [31mStop!
> [0m?[32mGo!
> [0m
> 
> There goes the cross platform compatibilty of my program :( - Trust
> Microsoft not to have built in ANSI in Win2k command prompts. To enable
> it you have to revert to using old DOS based command interpreter, and it
> doesn't even work for programs, only command prompts. Sigh.
> 
> Thanks anyway, I can probably use this for some of my other *nix-only
> programs.

I think the program should work on Windows/DOS systems (though I don't 
know if Win2k has screwed it up, as you suggest).  You have to set up 
the system correctly, by adding a line to CONFIG.SYS or CONFIG.NT as 
appropriate.  Search this newsgroup just last week for a thread on this 
very issue.  I don't know if the solution is limited to command prompts 
or works with programs; an experiment would resolve that.

The phenomenon here seems to be very typical Unix-centrism in the FAQ 
(and of course in other documentation).  Either this particular FAQ 
should be enhanced to discuss the Windows/DOS issue, or something should 
be added to perlport or to the ActivePerl FAQ about this issue.

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


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

Date: Tue, 09 May 2000 20:35:25 GMT
From: aphiny6592@my-deja.com
Subject: Iterating an array question?
Message-Id: <8f9sqc$vl0$1@nnrp1.deja.com>

I have an array in perl in which I'd like to run
an operation only on every other element.  Using
a foreach construct, how do I iterate the array
counter to move to the next line without using
the next command.  I.e.

foreach $item (@array)
{
     # how do iterate explicitly
     $item++;  # ????
}

Thanks,
Yin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 09 May 2000 20:37:30 GMT
From: yin_12180@yahoo.com
Subject: Iterating an array question?
Message-Id: <8f9su8$vm7$1@nnrp1.deja.com>

I have an array in perl in which I'd like to run an operation only on
every other element.  Using a foreach construct, how do I iterate the
array counter to move to the next line without using the next command.
I.e.

foreach $item (@array)
{
     # how do iterate explicitly
     $item++;  # ????
}

Thanks,
Yin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 9 May 2000 14:19:42 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Iterating an array question?
Message-Id: <MPG.138220c68c766a8098aa3c@nntp.hpl.hp.com>

In article <8f9su8$vm7$1@nnrp1.deja.com> on Tue, 09 May 2000 20:37:30 
GMT, yin_12180@yahoo.com <yin_12180@yahoo.com> says...
> I have an array in perl in which I'd like to run an operation only on
> every other element.  Using a foreach construct, how do I iterate the
> array counter to move to the next line without using the next command.
> I.e.
> 
> foreach $item (@array)
> {
>      # how do iterate explicitly
>      $item++;  # ????
> }

Well, certainly not that way.  $item isn't an index; it is an alias to 
each element of the array in turn, which you have just incremented (or 
something :-).

  my $i = 0;
  for my $item (@array) {
       next if $i++ % 2;
       # Do whatever you want here
  }

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


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

Date: Tue, 09 May 2000 18:51:03 GMT
From: nfin8axs@hotmail.com
Subject: Multi-threading and perl
Message-Id: <8f9mmg$o2q$1@nnrp1.deja.com>

I read somewhere that perl 5.005 will support multi-threading, as the
current versions to not support TRUE multi-threading. Can anyone
corroborate this?  I this in-fact the case?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 09 May 2000 19:41:54 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Multi-threading and perl
Message-Id: <6SZR4.82139$hT2.344364@news1.rdc1.ct.home.com>

nfin8axs@hotmail.com wrote:
> I read somewhere that perl 5.005 will support multi-threading, as the
> current versions to not support TRUE multi-threading. Can anyone
> corroborate this?  I this in-fact the case?

5.005 supports real multithreading if you build it in. The current
version's 5.6.0, but it supports real multithreading too if you build it
in.

					Dan


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

Date: Tue, 9 May 2000 22:39:57 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: NetworkSolutions - example of lapse security
Message-Id: <8fa0ju$810$1@uranium.btinternet.com>

Hey,

This made me laugh my ass off:

http://www.networksolutions.com/cgi-bin/makechanges/easysteps/easysteps.pl?S
TRING=maymun.com.pl?STRING=dmaymun.com&FILE=/../../../../../../../etc/passwd

Just an example of how CGI scripts can be a major security hazard ...


Thanks, Andy.
andy@u2me3.com




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

Date: Tue, 09 May 2000 19:19:14 GMT
From: "rbbdsb" <rbbdsb@earthlink.net>
Subject: Newbie brain fade
Message-Id: <SwZR4.45049$g4.1226690@newsread2.prod.itd.earthlink.net>

Hi,
  I'm having a serious brain fade.  I have some data

  word word word word First Second Third word word ....

I need to find First , trap Second, and overwrite with at different order,
removing the third word.

  word word word word Second First word word ....

I've been working with

  s/(^|\s+)First \s+(\w+)\s+\w+/$1 zzz/;

with predictable results.  I know this should be simple, but I can't seem to
make it work.

Any help appreciated.

Russ





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

Date: Tue, 09 May 2000 13:27:05 -0800
From: "Jonathan Young" <mordecai@teleport.com>
Subject: Re: Newbie brain fade
Message-Id: <Xu_R4.7194$0L4.482357@nntp3.onemain.com>

In article <SwZR4.45049$g4.1226690@newsread2.prod.itd.earthlink.net>,
"rbbdsb" <rbbdsb@earthlink.net> wrote:
> Hi,
>   I'm having a serious brain fade.  I have some data
> 
>   word word word word First Second Third word word ....
> 
> I need to find First , trap Second, and overwrite with at different
> order, removing the third word.
> 
>   word word word word Second First word word ....
> 
> I've been working with
> 
>   s/(^|\s+)First \s+(\w+)\s+\w+/$1 zzz/;
> 

I'm no guru, but....

   s/((First)\s+(\w+)\s+(\w+))/$3 $2/

I'm sure that could be dont better, but hell, I figured I'd give it a shot at least:)

j.


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

Date: Tue, 9 May 2000 13:24:33 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie brain fade
Message-Id: <MPG.138213e16d662ba798aa38@nntp.hpl.hp.com>

In article <SwZR4.45049$g4.1226690@newsread2.prod.itd.earthlink.net> on 
Tue, 09 May 2000 19:19:14 GMT, rbbdsb <rbbdsb@earthlink.net> says...

 ...

>   word word word word First Second Third word word ....
> 
> I need to find First , trap Second, and overwrite with at different order,
> removing the third word.
> 
>   word word word word Second First word word ....
> 
> I've been working with
> 
>   s/(^|\s+)First \s+(\w+)\s+\w+/$1 zzz/;
> 
> with predictable results.  I know this should be simple, but I can't seem to
> make it work.

It seems straightforward enough.  Start with a word-boundary assertion 
\b (see perlre for details).

    s/\b(First\W+)(\w+\W+)\w+\W+/$2$1/;

I'm uncomfortable with your mixture of \w and \S.  One should choose 
consistently between \w and \W or \s and \S, as appropriate for your 
needs.

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


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

Date: Tue, 9 May 2000 13:48:24 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie brain fade
Message-Id: <MPG.1382197244944a7698aa3a@nntp.hpl.hp.com>

In article <Xu_R4.7194$0L4.482357@nntp3.onemain.com> on Tue, 09 May 2000 
13:27:05 -0800, Jonathan Young <mordecai@teleport.com> says...
> In article <SwZR4.45049$g4.1226690@newsread2.prod.itd.earthlink.net>,
> "rbbdsb" <rbbdsb@earthlink.net> wrote:
> >   I'm having a serious brain fade.  I have some data
> > 
> >   word word word word First Second Third word word ....
> > 
> > I need to find First , trap Second, and overwrite with at different
> > order, removing the third word.
> > 
> >   word word word word Second First word word ....
> > 
> > I've been working with
> > 
> >   s/(^|\s+)First \s+(\w+)\s+\w+/$1 zzz/;
> > 
> 
> I'm no guru, but....
> 
>    s/((First)\s+(\w+)\s+(\w+))/$3 $2/
> 
> I'm sure that could be dont better, but hell, I figured I'd give it a shot at least:)

Your shot's OK, except for not having a delimiter ahead of 'First' to 
prevent matching 'notFirst', for example.

But don't you wonder what happened to $1 and $4 in your substitution?  
In this case, there should be no parentheses at all where they are; if 
parentheses are needed for grouping, they can be marked with (?: ... ) 
to prevent unneeded captures.

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


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

Date: 9 May 2000 18:39:12 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: Output user input to a plain text file
Message-Id: <8f9m0g$4a4$1@216.155.32.13>

In article <shf9h9do5uh35@corp.supernews.com>, "James Cook" 
<jcook@redgorilla.com> wrote:

 | # attempting to post code to another file called "field.txt"
 | 
 | $FILE = 'field.txt';
 | open (FILE,"< $FILE") || die "Can't open $FILE: $!\n";
               ^
change that to > since you are OUTputting. you might also want to change 
the filehandle to OUT since that looks clearer later buried in gobs of 
code. 
so

open (OUT,">$FILE") || die "Can't open $FILE: $!\n";

 | print header('text/plain');
 | print ("$field1\n");
 | print ("$field2\n");
 | print ("$field3\n");

#change these to 

  print OUT header('text/plain');
  print OUT ("$field1\n");
  print OUT ("$field2\n");
  print OUT ("$field3\n");
}
close OUT;

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 9 May 2000 21:07:42 +0200
From: "Christian Goebel" <christian.goebel@luxmail.lu>
Subject: Re: Parallel port
Message-Id: <8f9nk8$ab3ib$1@fu-berlin.de>

I haven't found anything that i can use in the deja.com database...

"Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
news:8f25iq$p08$1@orpheus.gellyfish.com...
> On Sat, 6 May 2000 17:53:25 +0200 Christian Goebel wrote:
> > Hi,
> > how I can send a byte to the parallel port (linux,apache)?
> > Can you give me an example?
> > best regards,
>
> This is similar to the answer in perlfaq8:
>
>        How do I read and write the serial port?
>
> Except you use the appropriate device for your parallel port.  You might
> also want to search Deja News as this was discussed recently.
>
> /J\
> --
> Ahh, the college roadtrip. What better way to spread beer fueled mayhem?
> --
> fortune oscar homer




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

Date: Tue, 9 May 2000 11:35:57 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Pattern Matching
Message-Id: <MPG.1381fa6abad21b2298aa31@nntp.hpl.hp.com>

In article <39183040.F8FE417C@vpservices.com> on Tue, 09 May 2000 
08:35:28 -0700, Jeff Zucker <jeff@vpservices.com> says...

 ...

> If the data is always as simple as you show it, with no embedded commas,
> then what you probabaly want is the split() function, not a regular
> expression as you are trying.  The split function takes a string and
> turns it into an array.

<pedantry severity=mild> The split function takes a string and turns it 
into a list, which may then be stored into an array. </pedantry>

> my @array = split( /,/, $label);  # creates an array from your string
> print $#array;               # tells how many fields are in the array

Well, almost.  But many bugs are 'off-by-one' errors, aren't they?

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


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

Date: Tue, 09 May 2000 11:51:58 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Pattern Matching
Message-Id: <39185E4E.67E48369@vpservices.com>

Larry Rosler wrote:
> 
> In article <39183040.F8FE417C@vpservices.com> on Tue, 09 May 2000
> 08:35:28 -0700, Jeff Zucker <jeff@vpservices.com> says...
> 
> ...
> 
> > If the data is always as simple as you show it, with no embedded commas,
> > then what you probabaly want is the split() function, not a regular
> > expression as you are trying.  The split function takes a string and
> > turns it into an array.
> 
> <pedantry severity=mild> The split function takes a string and turns it
> into a list, which may then be stored into an array. </pedantry>

<contrite>yep</contrite>

> 
> > my @array = split( /,/, $label);  # creates an array from your string
> > print $#array;               # tells how many fields are in the array
> 
> Well, almost.  But many bugs are 'off-by-one' errors, aren't they?

I should take my hands off the keyboard for a while, that's three simple
ones you've caught in the past hour.

-- 
Jeff


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

Date: 9 May 2000 18:55:44 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: Perl code to check for broken links
Message-Id: <8f9mvg$4a4$2@216.155.32.13>

In article <m1u2g7lpdu.fsf@halfdome.holdit.com>, merlyn@stonehenge.com 
(Randal L. Schwartz) wrote:

 | >>>>> "Erick" == Erick Jensen <erick.jensen@unisys.com> writes:
 | 
 | Erick> Maybe "the author of three of the top books on Perl" should
 | Erick> take a course of commenting his code and using meaningful
 | Erick> variable names (e.g., Hungarian notation).
 | 
 | I've not written anything for public consumption that wasn't
 | extensively commented; for example, the code for all my columns comes
 | with (duh!) a column that extensively documents what each line does.
 | 
 | Perl variables are already strongly typed: you cannot store a hash in
 | an array, or an array in a scalar, so they have built-in Hungarian
 | notation.
 | 
 | Erick> Not to mention the use of jump labels.  Ugly.  Maybe then
 | Erick> people could follow it.
 | 
 | What do you mean "jump labels".  Perl doesn't have "jumps".
 | 
 | But really, what was the purpose of your paragraph?  Are you angry at
 | something?  Someone?  At me?  What did you hope to accomplish by
 | saying that?  Are you trying to vent so that you are no longer
 | obligated to feel the feelings you have?  Or are you trying to attack
 | me?  Or the original poster?  If so, what is the purpose in that?
 | 
 | Curious.  Wondering why the dynamics of this newsgroup work this way.

Hey Randal .. just found your columns.. nice! helped me get through some 
weidnesses I was having with a script . . :) 

 ..speaking of dynamics .. <evil grin> 

*looks at above angry poster*

*plonk*

 .. now THAT's dynamic reallocation! hee! :D

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 9 May 2000 18:57:39 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: Perl code to check for broken links
Message-Id: <8f9n33$4a4$3@216.155.32.13>

In article <MPG.1381eaefe0b1df4598aa2c@nntp.hpl.hp.com>, Larry Rosler 
<lr@hpl.hp.com> wrote:

 | In article <391d3a28.26949335@news.skynet.be> on Tue, 09 May 2000 
 | 16:20:54 GMT, Bart Lateur <bart.lateur@skynet.be> says...
 | > Erick Jensen wrote:
 | > 
 | > >I just wanted something that would return whether a link is accesible 
 | > >or
 | > >not.  LWP::Simple get() does that for me.
 | > 
 | > It will do more: it will fetch the entire page for you.
 | > 
 | > At least, try using LWP::Simple's Head() instead.
 | 
 | With the understanding that -- if that fails -- you still have to try 
 | the GET, because some servers won't respond to HEAD requests.


"some servers" being, let me guess, NT servers? :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 09 May 2000 15:01:35 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Perl code to check for broken links
Message-Id: <brian-ya02408000R0905001501350001@news.panix.com>

In article <8f9n33$4a4$3@216.155.32.13>, The WebDragon <nospam@devnull.com> posted:

> In article <MPG.1381eaefe0b1df4598aa2c@nntp.hpl.hp.com>, Larry Rosler 
> <lr@hpl.hp.com> wrote:


>  | With the understanding that -- if that fails -- you still have to try 
>  | the GET, because some servers won't respond to HEAD requests.

> "some servers" being, let me guess, NT servers? :)

NT is an operating system.  Netscape Enterprise, however, is a 
goofy server when it comes to HEAD requests, despite platform.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 9 May 2000 12:22:09 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl code to check for broken links
Message-Id: <MPG.1382053faeef65e998aa34@nntp.hpl.hp.com>

In article <8f9n33$4a4$3@216.155.32.13> on 9 May 2000 18:57:39 GMT, The 
WebDragon <nospam@devnull.com> says...
> In article <MPG.1381eaefe0b1df4598aa2c@nntp.hpl.hp.com>, Larry Rosler 
> <lr@hpl.hp.com> wrote:
> 
>  | In article <391d3a28.26949335@news.skynet.be> on Tue, 09 May 2000 
>  | 16:20:54 GMT, Bart Lateur <bart.lateur@skynet.be> says...
>  | > Erick Jensen wrote:
>  | > 
>  | > >I just wanted something that would return whether a link is accesible 
>  | > >or
>  | > >not.  LWP::Simple get() does that for me.
>  | > 
>  | > It will do more: it will fetch the entire page for you.
>  | > 
>  | > At least, try using LWP::Simple's Head() instead.
>  | 
>  | With the understanding that -- if that fails -- you still have to try 
>  | the GET, because some servers won't respond to HEAD requests.
> 
> 
> "some servers" being, let me guess, NT servers? :)

I see the smiley, but I don't get your point.  It can have nothing to do 
with the operating system.  Many servers have implementations for 
several operating systems.

It may be a matter of server configuration, but in any case it no longer 
has anything to do with Perl.

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


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

Date: Tue, 09 May 2000 21:25:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl code to check for broken links
Message-Id: <391f80fc.45081011@news.skynet.be>

Larry Rosler wrote:

>> At least, try using LWP::Simple's Head() instead.
>
>With the understanding that -- if that fails -- you still have to try 
>the GET, because some servers won't respond to HEAD requests.

Is there a possibility to virtually "press 'Cancel'"? You don't have to
download the whole page. Just checking the headers is enough. These come
upfront.  ;-)

One of my CGI scripts, which returns image files, also logs start and
finish of the download. Checking through the logs, I notice a LOT more
"start" than "finish" entries. And no, it's not the impatient users:
it's the file caching mechanism of the browser, which starts downloading
the file, says "ooh, same length and same date and time, I've got that
one already", and aborts, killing my script.

So I guess that this is normal behaviour.

-- 
	Bart.


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

Date: Tue, 09 May 2000 14:06:01 -0700
From: Aaron <alager@csuchico.edu>
Subject: printing to a winNT printer
Message-Id: <39187DB9.1974F063@csuchico.edu>

I'm using perl32 on NT and want to send data to one of the printers
installed on the local machine.  The physical printer
is not plugged into the computer it is a jetdirect printer, but it is
listed under mycomputer->pritners.  I've tried opening it
by name but that just creates a file with the same name.  Any help you
could provide would be great.

Aaron




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

Date: Tue, 9 May 2000 17:50:53 -0400
From: "Cary Lewis" <cslewis@mobilecom.com>
Subject: Re: semaphores under perl
Message-Id: <ZA%R4.4583$Ip.153653@cac1.rdr.news.psi.ca>

I am running under BSDI so semget is there. How can I install the
appropriate module locally, if the system does not already have it
configured this way?
<nobull@mail.com> wrote in message news:u9itwnipt2.fsf@wcl-l.bham.ac.uk...
> "Cary Lewis" <cslewis@mobilecom.com> writes:
>
> > I am getting the following error:
> >
> > semget not implemented at /usr/local/lib/perl5/5.00502/IPC/Semaphore.pm
line
> > 38.
> >
> > Can someone suggest why that is?
>
> Have you eleiminated the obvious i.e. your OS doesn't implement SysV
> Semaphores?
>
> --
>      \\   ( )
>   .  _\\__[oo
>  .__/  \\ /\@
>  .  l___\\
>   # ll  l\\
>  ###LL  LL\\




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

Date: Tue, 9 May 2000 12:15:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: signal trapper
Message-Id: <Pine.GSO.4.10.10005091208400.3921-100000@user2.teleport.com>

On Tue, 9 May 2000, Andy Chantrill wrote:

> I've been playing around with signal trapping for ages, and I've never
> been able to get it work properly the way I'd like in a modular
> structure (see my example). What I really need is a goto function that
> can leap out of the signal_trapper sub-routine into the status
> sub-routine ...

Well, that's not how subroutines in Perl are intended to be used. If you
don't like the results of using a violin to swat flies, maybe you should
meditate for a time in the hope that soon you'll better understand the
raison d'etre of a fly. :-)

Try thinking of your problem this way, even though it may not lead to a
solution at first: When a signal comes in, you're going to go do
"something" and then return to your regularly-scheduled programming. Now,
what should that "something" be?

Perhaps you wish to divert your main program to do something else when the
signal comes in. In that case, "something" should perhaps be setting a
flag that the main program can look for.

Does that get you any closer to a solution?

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



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 2995
**************************************


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