[16650] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4062 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 18 21:05:33 2000

Date: Fri, 18 Aug 2000 18:05:18 -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: <966647118-v9-i4062@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 18 Aug 2000     Volume: 9 Number: 4062

Today's topics:
        $PREMATCH and $POSTMATCH fgont@my-deja.com
    Re: $PREMATCH and $POSTMATCH <uri@sysarch.com>
    Re: $PREMATCH and $POSTMATCH <care227@attglobal.net>
        change ',' to '","' <star@sonic.net>
    Re: Eval and Regexps Help <ren.maddox@tivoli.com>
    Re: Eval and Regexps Help bluearchtop@my-deja.com
    Re: Eval and Regexps Help <elephant@squirrelgroup.com>
    Re: Following Hyperlinks with cgi (Slightly Off Topic) <godzilla@stomp.stomp.tokyo>
    Re: Following Hyperlinks with cgi (Slightly Off Topic) <amonotod@netscape.net>
    Re: Following Hyperlinks with cgi <gellyfish@gellyfish.com>
    Re: GD.pm Test Fails? <stevenjm@telisphere.com>
        help foreach doesn't work cornelhughes@netscape.net
    Re: help foreach doesn't work <juex@deja.com>
    Re: Help! About running perlscript in Browser. (David Efflandt)
        HELP: interpolation of patterns and the pos command (Dragomir R. Radev)
    Re: HTML::Parser <gellyfish@gellyfish.com>
    Re: I need help with ffa links script (David Efflandt)
    Re: is STDIN a pipe, file, or tty? <gellyfish@gellyfish.com>
        Matching the e-mail header fgont@my-deja.com
    Re: Matching the e-mail header <care227@attglobal.net>
    Re: My script has some bugs (Gwyn Judd)
        Need some quick help.. <snakeman@kc.rr.com>
    Re: Need some quick help.. <tony_curtis32@yahoo.com>
    Re: network operations under perl (dionysus)
    Re: network operations under perl (dionysus)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 18 Aug 2000 23:09:33 GMT
From: fgont@my-deja.com
Subject: $PREMATCH and $POSTMATCH
Message-Id: <8nkfn0$2c1$1@nnrp1.deja.com>

Hi, guys!

I've FOUND that $PREMATCH an $POSTMATCH functions don't work in the
same way as $` ans $'...
I mean, if I use them, my code doesn't work, but if I use $` and $'
instead, my code works OK... do you know why?

Kind regards,

Fernando Ariel Gont

e-mail: fgont@NOSPAM.softhome.net



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


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

Date: Fri, 18 Aug 2000 23:33:52 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: $PREMATCH and $POSTMATCH
Message-Id: <x7sns2uotb.fsf@home.sysarch.com>

>>>>> "f" == fgont  <fgont@my-deja.com> writes:

  f> I've FOUND that $PREMATCH an $POSTMATCH functions don't work in the
  f> same way as $` ans $'...
  f> I mean, if I use them, my code doesn't work, but if I use $` and $'
  f> instead, my code works OK... do you know why?

those are just aliases to the shorter names and they are declared in
English.pm. are you using that?

and you shouldn't use $` and $' as they slow down all regexes in your
program. use grabbing parens instead.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 18 Aug 2000 19:44:22 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: $PREMATCH and $POSTMATCH
Message-Id: <399DCA56.84B8AFC3@attglobal.net>

fgont@my-deja.com wrote:
> 
> Hi, guys!
> 
> I've FOUND that $PREMATCH an $POSTMATCH functions don't work in the
> same way as $` ans $'...
> I mean, if I use them, my code doesn't work, but if I use $` and $'
> instead, my code works OK... do you know why?

I know why, but I'm silly and I read documentation when it is 
available.  I guess I have more free time than you do, huh?

From perlvar:

:The following names have special meaning to Perl. Most punctuation 
:names have reasonable mnemonics, or analogues in one of the shells. 
:Nevertheless, if you wish to use long variable names, you just need 
:to say 
:
:    use English;


Holy cow!  The _very_ first paragraph explained your question.  What 
a surprise.


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

Date: Fri, 18 Aug 2000 23:39:34 GMT
From: arthur <star@sonic.net>
Subject: change ',' to '","'
Message-Id: <B5C26E5C.69A5%star@sonic.net>

Hi,

I have a form that returns 'question' and prints it on dat.html. I want to
be able to put quotation marks on both sides of any commas that are in
'question' and print it on dat.html..

Lets say someone put "hi,bye" in the form I want "hi","bye" to be printed on
the form.
---------
open (HOPE, ">/home/www_pages/star/dat.html") || die print "cant open:$!\n";

print (HOPE uc(param('question')));

close HOPE;

Thanks,
~arthur




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

Date: 18 Aug 2000 16:15:55 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Eval and Regexps Help
Message-Id: <m3d7j69sok.fsf@dhcp11-177.support.tivoli.com>

bluearchtop@my-deja.com writes:

> 1) It doesn't print the evaluated code in the place I want it.
> It prints a 1 where I want the output to go.

I don't know about problems 2 or 3, but you can easily fix problem 1
by removing the print statements from the <% %> blocks.  Just put the
expressions you want printed, and the eval will (natch.), the s///
will substitute them and away you go....

-- 
Ren Maddox
ren@tivoli.com


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

Date: Sat, 19 Aug 2000 00:15:35 GMT
From: bluearchtop@my-deja.com
Subject: Re: Eval and Regexps Help
Message-Id: <8nkjip$6mc$1@nnrp1.deja.com>

In article <m3d7j69sok.fsf@dhcp11-177.support.tivoli.com>,
  Ren Maddox <ren.maddox@tivoli.com> wrote:
> bluearchtop@my-deja.com writes:
>
> > 1) It doesn't print the evaluated code in the place I want it.
> > It prints a 1 where I want the output to go.
>
> I don't know about problems 2 or 3, but you can easily fix problem 1
> by removing the print statements from the <% %> blocks.  Just put the
> expressions you want printed, and the eval will (natch.), the s///
> will substitute them and away you go....

Thanks, but that didn't work for me. Example:

$str=<<_EOF_;

The current time is:
<%
$x=localtime(time);
$x;
%>
_EOF_
$str=~s/<%(.*?)%>/eval($1)/ges;
print $str;

This just prints:
The current time is:

What am I doing wrong?


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


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

Date: Sat, 19 Aug 2000 00:39:57 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Eval and Regexps Help
Message-Id: <MPG.140874c92d9b74139896cf@localhost>

bluearchtop@my-deja.com wrote ..
>jason <elephant@squirrelgroup.com> wrote ..
>> what you're really trying to do is print everything outside of <%%>s
>> and execute everything inside <%%> .. your simple substitution will
>> not accomplish this
>
>Yes, that is exactly correct. Can you point me in the right direction
>for doing this?

umm .. that was about all the pointing you're going to get .. it's a 
fairly blatant clue .. print everything outside the <%%>s and execute 
everything inside the <%%>s

  [ attribution reinserted ]

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Fri, 18 Aug 2000 15:39:35 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Following Hyperlinks with cgi (Slightly Off Topic)
Message-Id: <399DBB27.98C5AE97@stomp.stomp.tokyo>

Russ Jones wrote:
 
> "Godzilla!" wrote:
> > Russ Jones wrote:

(snippage) 

> If the data center was nuked along with the air base across 
> the street, secondary backups and the hard-copy  would be 
> recalled from the salt mines and carried to a
> non-radio-active backup site.

Short of a terrorist backpack event, it wouldn't matter,
not for a second. A nuclear strike indicates retaliatory
strikes. All living things, outside of our oceans, would
be dead within five to ten days due to radiation spread
by atmospheric currents and, oceanic life, almost all, 
if not all, would be dead within thirty to sixty days.
Doubtful anyone would bother with backup data. Such is
reality, yes? 

Chernobyl is a cork pop gun compared to a full on old 
fashion atomic bomb. As you know, a relatively minor event
such Chernobyl exhibited worldwide effects. No doubt a
few Hydrogen Bombs would ruin your picnic. However, ants,
cockroaches and other insects with iodine laced hard
exoskeletons "could" survive. Planet Of The Cockroaches!

Reality dictates best laid security plans of mice and men,
are meaningless. Those responsible for emergency responses
during an atomic war, will be too busy vomiting and picking
at their skin ruptures to worry about slipping a disk into
a drive, which wouldn't work anyhow with virtually all power
grids and electronic devices knocked down by electromagnetic
impulses from thermonuclear explosions, even at hundreds of
miles distance.

Reality is a bitch, yes?

> Since I AM only speaking hypothetically, it probably wouldn't be right
> for me to mention that you don't seem to have any grasp of what goes
> on in hypothetical corporate data centers where such things as
> disaster recovery plans and firewalls and backups are common place.

I have enough grasp on what goes on to mind my manners and
am aware a good corporate image includes minding your manners,
regardless if you are a corporate peon or a corporate CEO.

Clearly you are not aware of myriad security techniques on
a worldwide basis. Raytheon is not a Dark Ages Center of
the Universe. Others practice security measures different
than your own and, some practice security measures similar
to your own.

Godzilla!


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

Date: Fri, 18 Aug 2000 23:33:42 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Following Hyperlinks with cgi (Slightly Off Topic)
Message-Id: <8nkh4m$40i$1@nnrp1.deja.com>

In article <399DBB27.98C5AE97@stomp.stomp.tokyo>,
  "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> Clearly you are not aware of myriad security techniques on
> a worldwide basis. Raytheon is not a Dark Ages Center of
> the Universe. Others practice security measures different
> than your own and, some practice security measures similar
> to your own.
>
> Godzilla!
>
Oh man, I just realized, you're not a troll, you're a freaking
encyclopedia of IT knowledge.  Someone should should hook up your brain
to a web server so that all of us idiots can ask you questions on
demand.  Since that is not feasible however, I have come up with an AI
program that will emulate you:

#!perl
print "Blah Blah Blah" x 10000000;
exit;


amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: 18 Aug 2000 23:00:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <8nkblm$bkv$1@orpheus.gellyfish.com>

On Fri, 18 Aug 2000 17:30:52 GMT Jeremiah Adams wrote:
> Hi,
> 
> Can someone tell me how to follow hyperlinks with perl? Or send me to a faq
> or website? IE, I want to submit a link to the script and have the script
> resolve it.
> 

LWP::UserAgent, HTML::LinkExtor .... I'm not quite sure what you are asking.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Fri, 18 Aug 2000 23:22:56 GMT
From: Steven May <stevenjm@telisphere.com>
Subject: Re: GD.pm Test Fails?
Message-Id: <399DC516.4400025F@telisphere.com>

Martien Verbruggen wrote:
> 
> On Fri, 18 Aug 2000 06:33:08 GMT,
>         Steven May <stevenjm@telisphere.com> wrote:
> > brudden@goebusiness.com wrote:
> > >
> > > I'm having problems with the GD.pm module on sun sparc solaris 2.6
> >
> > For what it's worth, I spent 2 days a month or so back trying to get
> > GD working on a linux box (admittedly with pretty well hosed libraries)
> > and after finally getting it running, dicovered it really wouldn't do
> > what I wanted anyway. (I know, RTFM BEFORE installing)
> >
> > So I snooped around and gave Magick a shot.
> 
> PerlMagick and GD have totally different application domains. Many
> things that can be done in PerlMagick can be done in GD, Even more
> things that can be done in GD can be done in PerlMagick. However, the
> interfaces to those things to do, as well as the general possibilities
> are different, and are aimed at different tasks.
> 
> You're comparing apples with coconuts.
> 

Yep, didn't say that though, did I?  Should have, because it was in
my mind when I wrote the post. Brain fade worse than normal. :-(

Guess my point (if any) was that if I'd put a little more thought
into what tasks I needed GD for before diving in, I'd have known
up front it wasn't going to meet my needs and gone looking for
something else (Magick) earlier in the process.  Which, as stated
was lots easier (for me) to install.  Could have been easier because
of all the upgrading and general fixing I did to get GD running 
though.  Hmmmm....

Anyway, it occurred to me that the OP might not have looked at Magick???

No great harm done I suppose.

Thanks Martien. :-)

Steve


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

Date: Sat, 19 Aug 2000 00:12:56 GMT
From: cornelhughes@netscape.net
Subject: help foreach doesn't work
Message-Id: <8nkjdr$6d1$1@nnrp1.deja.com>

I am new to perl and trying to figure out why the following code won't
work? Why doesn't the following code print "Why Don't you work";

# determine which week to display, creates var- schedweek
$indx = 0;
$schedweek = 0;
foreach $week (@week) {
print "Why don't you work";
   if (index($datetxt[$indx],"MONDAY")>0) {    # the week of Monmad are
defined by monday
      if (($gameyear[$indx] > $year) || (($gameyear[$indx] == $year) &&
($gamemonth[$indx] > $mon)) || (($gameyear[$indx] == $year) &&
($gamemonth[$indx] == $mon) && ($gameday[$indx] > $mday)) || (($gameyear
[$indx] == $year) && ($gamemonth[$indx] == $mon) && ($gameday[$indx] ==
$mday) && ($gamehour > $hour))) {
            $schedweek = $week;
            last;
         }


      }

   $indx +=1;
   }





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


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

Date: Fri, 18 Aug 2000 17:35:37 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: help foreach doesn't work
Message-Id: <399dd65c@news.microsoft.com>

<cornelhughes@netscape.net> wrote in message
news:8nkjdr$6d1$1@nnrp1.deja.com...
> I am new to perl and trying to figure out why the following code won't
> work? Why doesn't the following code print "Why Don't you work";
>
> # determine which week to display, creates var- schedweek
> $indx = 0;
> $schedweek = 0;

Maybe because @week doesn't contain a single item?

> foreach $week (@week) {
> [...]

jue




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

Date: Sat, 19 Aug 2000 00:28:33 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Help! About running perlscript in Browser.
Message-Id: <slrn8prl5j.3d5.efflandt@efflandt.xnet.com>

On Fri, 18 Aug 2000 18:35:33 GMT, hewuma@yahoo.com <hewuma@yahoo.com> wrote:
>Hi All!
>I have a question.
>I run perlscript in browser? Small one is running well. But for the
>large perlscript, I got following error message:
>The page cannot be displayed
>The page you are looking for is currently unavailable. The Web site
>might be experiencing technical difficulties, or you may need to adjust
>your browser settings.

(snip)

>Cannot find server or DNS Error
>Internet Explorer
>How to solve the problem?
>Hope anybody can answer my question
>Hewu

Does your script run successfully in a DOS window?

See the docs or a newsgroup about your webserver.  If you are not running
a webserver, that may be your problem.  If you are used IIS you might want
to install PWS from the Win98 CD (or from NT Option Pack 4 for Win95), or
if used to Apache, download the Win32 version from http://www.apache.org/

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: 18 Aug 2000 20:02:43 -0400
From: radev@quip.eecs.umich.edu (Dragomir R. Radev)
Subject: HELP: interpolation of patterns and the pos command
Message-Id: <8nkir3$knj$1@quip.eecs.umich.edu>

I am trying to see where in $long does a substring $short appear.

======================
#!/bin/perl

$long = <>;
chop $long;
$short = <>;
chop $short;

$long =~ m/$short/g;
$pos = pos $long;

print "$pos\n";
======================


The code above works fine except in the cases where $short and $long
contain special symbols.

E.g., when $long is:

The ticket wins $one million
____________________________

and $short is:

wins $one
_________

In such a case, the variable $one in $short gets interpolated and the
result is not what I want. I have tried escaping some weird characters
in $short: e.g. the dollar sign:

$short =~ s/\$/\\\\$/g;

but there are others that cause the same problem ("?","/", etc.). Is
there an exhaustive list of such meta-characters that I could escape
one by one or is there a routine or technique either for escaping the
entire pattern ($short) or for running the pos command with no
interpolation?

Thanks.

Drago

-- 
Dragomir R. Radev                                         radev@umich.edu
Assistant Professor, School of Information         University of Michigan
Assistant Professor, Dept. of Electrical Engineering and Computer Science
Phone: 734-615-5225   Fax: 734-763-2285    http://www.si.umich.edu/~radev


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

Date: 18 Aug 2000 22:19:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HTML::Parser
Message-Id: <8nk98l$bi9$1@orpheus.gellyfish.com>

On Fri, 18 Aug 2000 10:05:15 -0700 Gabe wrote:
> The docs say $p->parse_file($file) returns a reference to the parser object.
> What does this mean? I know what a reference is, but what's th parser
> object? Isn't that $p?
> 
> I want to print the content of the HTML page in question, I'm using the
> right module right? How do I print what HTML::Parser finds?
> 

There are plenty of examples of the use of the module posted here, you
might want to search Deja News or look at ( for instance ) the examples
I have at <http://www.gellyfish.com/htexamples/> ....

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Sat, 19 Aug 2000 00:49:39 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: I need help with ffa links script
Message-Id: <slrn8prmd4.3d5.efflandt@efflandt.xnet.com>

On Fri, 18 Aug 2000, jeffinnc68@my-deja.com <jeffinnc68@my-deja.com> wrote:
>
>I'm hoping someone can help me.  I started a free
>for all links page and want to allow automatic
>posting with software (FFAblaster, etc.) but
>cannot figure out what I have to add to let that
>happen.  I'm an amateur I admit but no where can
>i find this info.  Any help would be great if you
>can.  Email me at jborden@nc.rr.com if you have
>any suggestions.  Thanks.

Last time I helped someone with FFA Links, it was not y2k compliant and
had rather unrefined (bloated) code, including failing to flock files,
that resulted it all of the links suddenly disappearing.  But that was a
very busy site that seemed to get continuous hits, probably mostly from
porno sites using scripts to load up the site with their links using
wording that was hard to filter out.

You would probably be better off with something that allows you to review
links before they are posted.  Then you could weed out any that are
undesireable or post multiple links with different wording and paths.

A cgi newsgroup would be a better place to look for a recommendation,
since this one is just for Perl specific questions.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: 18 Aug 2000 23:12:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: is STDIN a pipe, file, or tty?
Message-Id: <8nkccg$bm3$1@orpheus.gellyfish.com>

On Fri, 18 Aug 2000 12:38:02 +0100 Brent Schenk wrote:
> Rafael Garcia-Suarez <rgarciasuarez@free.fr> wrote in message
> news:slrn8pqmc9.prp.rgarciasuarez@rafael.kazibao.net...
>> Daniel Becker wrote in comp.lang.perl.misc:
>> >How can one determine, from within a perl script, whether STDIN
>> >is reading from a pipe (eg "cat foo | perl script.pl"), or a file
>> >(eg "perl script.pl foo") or the user's tty (eg "perl script.pl")?
>>
>> man perlfunc
>>  --> lookup '-X FILEHANDLE'
>>
> I don't know the answer to your question, but this may help.  Here is how I
> take in the STDIN:
> 
> $referer = $ENV{'HTTP_REFERER'};
> $content_length = $ENV{'CONTENT_LENGTH'};
> read (STDIN, $posted_information, $content_length);
> 
> $posted_information is the stdin string.  I use that for webpages.  Maybe
> yours is something totally different
> 

No, The Original Poster's question had FA to do with the CGI and Rafael
was right - 

   perldoc -f -X

all of the tests that you will need to do on the filehandle to determine
whether it is opened to a tty, a plain file or a pipe are described here.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Fri, 18 Aug 2000 23:18:03 GMT
From: fgont@my-deja.com
Subject: Matching the e-mail header
Message-Id: <8nkg6s$30b$1@nnrp1.deja.com>

Hi!

I've read that the header of an e-mail message is separated from the
body by two "newlines" (\n\n).

I saved to disk the whole header and body of an e-mail message, and
found that this is true, as I found a 0dh 0ah 0dh 0ah between the last
line of the header and the first line of the body.

But if I make something like:

$_=$message;
if(/\n\n/){
       print"I found the header!\n";
}

The header is never found (the regexp does not match).... do you know
why?

Kind regards,

Fernando Ariel Gont
e-mail: fgont@NOSPAM.softhome.net



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


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

Date: Fri, 18 Aug 2000 19:54:16 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Matching the e-mail header
Message-Id: <399DCCA8.1AFD806A@attglobal.net>

fgont@my-deja.com wrote:
> 
> Hi!
> 
> I've read that the header of an e-mail message is separated from the
> body by two "newlines" (\n\n).
> 
> I saved to disk the whole header and body of an e-mail message, and
> found that this is true, as I found a 0dh 0ah 0dh 0ah between the last
> line of the header and the first line of the body.
> 
> But if I make something like:
> 
> $_=$message;
> if(/\n\n/){
>        print"I found the header!\n";
> }
> 

How did you read the data into $message?  Also, a mail header is not
seperated from the body by two newlines, but by one blank line, which 
can be rather different.


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

Date: Sat, 19 Aug 2000 00:40:08 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: My script has some bugs
Message-Id: <slrn8prlr6.dr1.tjla@thislove.dyndns.org>

I was shocked! How could Brent Schenk <brent.schenk@home.com>
say such a terrible thing:
>I have made sure that the headers are in there and everything.  I am trying
>to figure it out because this is holding me back from my job.  I think I
>will attach the script to this post for someone to look at.  It's just a

Your script doesn't even compile, I don't know how you can say it works
fine from the command line.

1) Change the top two lines of your script to:

#!/usr/bin/perl -w
use strict;

2) Run it again from the command line

3) Fix the bugs

4) Please don't post stuff encoded

5) Add the following two lines just below the "use strict;"

use CGI qw/:standard/;
use CGI::Carp 'fatalsToBrowser';

6) read up on CGI.pm:

http://www.cpan.org/doc/manual/html/lib/CGI.html

7) read up on file locking:

perldoc -f lock
perldock -q lock

8) read up on opening files and checking for errors:

perldoc open
perldoc perlopentut

9) please don't post stuff encoded

10) and don't post stuff that doesn't compile unless it's to ask "Why
doesn't my script compile"?

11) Add the following line just below the "use CGI::Carp" line:

print h();

12) You're welcome

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
If swimming is so good for your figure, how do you explain whales?


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

Date: Fri, 18 Aug 2000 23:04:34 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: Need some quick help..
Message-Id: <6ijn5.2564$H5.32745@typhoon.kc.rr.com>

Hello-
   I am wanting to print the last modified date to the html page. For
example using
    <!--#flastmod file="default.html" -->

but I don't want to edit it everytime I add it to a page. I know that
DOCUMENT_NAME will return the current filename but it wont work like this :

<!--#flastmod file="DOCUMENT_NAME" -->

due to the fact it is looking for an actual document called "DOCUMENT_NAME".

Thank You

Dirk




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

Date: 18 Aug 2000 18:05:56 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Need some quick help..
Message-Id: <87sns2yxt7.fsf@limey.hpcc.uh.edu>

>> On Fri, 18 Aug 2000 23:04:34 GMT,
>> "DS" <snakeman@kc.rr.com> said:

> Hello- I am wanting to print the last modified date to
> the html page. For example using <!--#flastmod
> file="default.html" -->

> but I don't want to edit it everytime I add it to a
> page. I know that DOCUMENT_NAME will return the current
> filename but it wont work like this :

> <!--#flastmod file="DOCUMENT_NAME" -->

> due to the fact it is looking for an actual document
> called "DOCUMENT_NAME".

So what do you want to know about perl?

t
-- 
"I'm not easily impressed.  Wow!  A blue car!"
                                               Homer Simpson


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

Date: Sat, 19 Aug 2000 00:56:50 GMT
From: dionysus39@hotmail.com (dionysus)
Subject: Re: network operations under perl
Message-Id: <399ddb06.111702712@nntp.unsw.edu.au>

Great....however Win32::Lanman does not seem to be part of the
activeperl distrub (not sure data::dumper is either), nor in
CPAN....exactly where can it be got from?

Thanks heaps,

-dionysus

On Fri, 18 Aug 2000 20:01:34 GMT, amonotod <amonotod@netscape.net>
wrote:

>In article <399d752f.85628023@nntp.unsw.edu.au>,
>  newsgroup@here.com wrote:
>> attempting to put together a program to enumerate all workgroups in
>> the LAN, all machines in a given workgroup, and all shared directories
>> on that machine (the idea is to search the LAN for a given filename).
>
>As posted by Simon Oliver <simon.oliver_at_umist.ac.uk> to the
>Perl-Win32-Admin mailing list,
>Perl-Win32-Admin@listserv.ActiveState.com,
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
>
>#!perl -w
>use strict;
>use Win32::Lanman;
>use Data::Dumper;
>
>my ($node, $domain, $dc);
>my $servers_info = [];
>my $servers = [];
>my $shares = {};
>
>$node = Win32::NodeName;
>$domain = Win32::DomainName;
>Win32::Lanman::NetGetAnyDCName($node, $domain, \$dc) or die $^E;
>
># get a list of servers
>Win32::Lanman::NetServerEnum($dc, $domain, SV_TYPE_SERVER,
>$servers_info) or die
>$^E;
>@{$servers} = map {$_->{name}} @{$servers_info};
>#print Dumper($servers), "\n";
>
># get the servers' shares and paths
>$shares = get_shares($servers, STYPE_PRINTQ);
>print Dumper($shares), "\n";
>
>exit;
>
>sub get_shares {
>	my ($servers, $constraint) = @_;
>	my $hash_ref = {};
>	foreach my $server (@$servers) {
>		$hash_ref->{$server} = get_server_shares($server,
>$constraint);
>	}
>	return $hash_ref;
>}
>
>sub get_server_shares {
>	my ($server, $constraint) = @_;
>	my @shares;
>	my $hash_ref = {};
>	Win32::Lanman::NetShareEnum($server, \@shares) or return;
>#	print "$server\n";
>	foreach my $share (@shares) {
>		if (defined $share->{path}){
>			if (defined $constraint) {
>				next unless ($share->{type} ==
>$constraint);
>			}
>#			print "\t$share->{netname},
>'$share->{remark}'\n";
>			$hash_ref->{$share->{netname}} =
>$share->{remark};
>		}
>	}
>	return $hash_ref;
>}
>_______________________________________________
>
>
>
>
>> Thanks heaps in advance
>>
>> -dionysus
>
>HTH,
>amonotod
>
>
>--
>    `\|||/                     amonotod@
>      (@@)                     netscape.net
>  ooO_(_)_Ooo________________________________
>  _____|_____|_____|_____|_____|_____|_____|_____|
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

Needing quick MP3-related help? Check Xorys' FAQ - http://webhome.idirect.com/~nuzhathl/mp3-faq.html


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

Date: Sat, 19 Aug 2000 01:04:33 GMT
From: dionysus39@hotmail.com (dionysus)
Subject: Re: network operations under perl
Message-Id: <399ddcd7.112167564@nntp.unsw.edu.au>

Hang on, don't worry, I found it eventually....but apparently it works
only on windows NT. Do you know of an equivalent package for win95?

-dionysus

On Fri, 18 Aug 2000 20:01:34 GMT, amonotod <amonotod@netscape.net>
wrote:

>In article <399d752f.85628023@nntp.unsw.edu.au>,
>  newsgroup@here.com wrote:
>> attempting to put together a program to enumerate all workgroups in
>> the LAN, all machines in a given workgroup, and all shared directories
>> on that machine (the idea is to search the LAN for a given filename).
>
>As posted by Simon Oliver <simon.oliver_at_umist.ac.uk> to the
>Perl-Win32-Admin mailing list,
>Perl-Win32-Admin@listserv.ActiveState.com,
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
>
>#!perl -w
>use strict;
>use Win32::Lanman;
>use Data::Dumper;
>
>my ($node, $domain, $dc);
>my $servers_info = [];
>my $servers = [];
>my $shares = {};
>
>$node = Win32::NodeName;
>$domain = Win32::DomainName;
>Win32::Lanman::NetGetAnyDCName($node, $domain, \$dc) or die $^E;
>
># get a list of servers
>Win32::Lanman::NetServerEnum($dc, $domain, SV_TYPE_SERVER,
>$servers_info) or die
>$^E;
>@{$servers} = map {$_->{name}} @{$servers_info};
>#print Dumper($servers), "\n";
>
># get the servers' shares and paths
>$shares = get_shares($servers, STYPE_PRINTQ);
>print Dumper($shares), "\n";
>
>exit;
>
>sub get_shares {
>	my ($servers, $constraint) = @_;
>	my $hash_ref = {};
>	foreach my $server (@$servers) {
>		$hash_ref->{$server} = get_server_shares($server,
>$constraint);
>	}
>	return $hash_ref;
>}
>
>sub get_server_shares {
>	my ($server, $constraint) = @_;
>	my @shares;
>	my $hash_ref = {};
>	Win32::Lanman::NetShareEnum($server, \@shares) or return;
>#	print "$server\n";
>	foreach my $share (@shares) {
>		if (defined $share->{path}){
>			if (defined $constraint) {
>				next unless ($share->{type} ==
>$constraint);
>			}
>#			print "\t$share->{netname},
>'$share->{remark}'\n";
>			$hash_ref->{$share->{netname}} =
>$share->{remark};
>		}
>	}
>	return $hash_ref;
>}
>_______________________________________________
>
>
>
>
>> Thanks heaps in advance
>>
>> -dionysus
>
>HTH,
>amonotod
>
>
>--
>    `\|||/                     amonotod@
>      (@@)                     netscape.net
>  ooO_(_)_Ooo________________________________
>  _____|_____|_____|_____|_____|_____|_____|_____|
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

Needing quick MP3-related help? Check Xorys' FAQ - http://webhome.idirect.com/~nuzhathl/mp3-faq.html


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

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


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