[17507] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4927 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 20 00:05:36 2000

Date: Sun, 19 Nov 2000 21:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974696712-v9-i4927@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 19 Nov 2000     Volume: 9 Number: 4927

Today's topics:
    Re: Accessing windows terminal server (Mark W. Schumann)
    Re: Can't run perl !! <Please_reply@this.group>
    Re: Do I need Java to redirect form parameters? (Mark W. Schumann)
    Re: File Extensions (Mark W. Schumann)
    Re: File Extensions <wyzelli@yahoo.com>
    Re: Free Online Sample Certification Questions (Chris Fedde)
    Re: Getting Bold Font on plain ASCII (Mark W. Schumann)
        how do I delete initial and final spaces in a string? <-@-.com>
    Re: how do I delete initial and final spaces in a strin <wyzelli@yahoo.com>
    Re: how do I delete initial and final spaces in a strin (John J. Trammell)
    Re: i/o multi-serial ports (Mark W. Schumann)
        Is "use GD;" a standard Perl Modules or function ? <claudej@videotron.ca>
    Re: Is "use GD;" a standard Perl Modules or function ? (Chris Fedde)
        just testing <dcuaron@cs.nmsu.edu>
    Re: Perl Illiterate (Tad McClellan)
    Re: PerlScript and ASP <joe+usenet@sunstarsys.com>
    Re: print "Location: revised (Mark W. Schumann)
    Re: Reading Serial ports? (Mark W. Schumann)
        rearranging a text file <vigne@nhamp.net>
    Re: rearranging a text file <wyzelli@yahoo.com>
    Re: rearranging a text file <wyzelli@yahoo.com>
    Re: Send a form to a script AND email/file (Mark W. Schumann)
    Re: sendmail with cgi.pm? (Mark W. Schumann)
    Re: simple perl script question (Mark W. Schumann)
    Re: still broken (Mark W. Schumann)
    Re: STOP REPEATED POSTING! Re: Problems saving an uploa <nospam@david-steuber.com>
        Strange behavior from localtime() Oct31 2000 or later <softh@bellsouth.net>
    Re: Strange behavior from localtime() Oct31 2000 or lat <joe+usenet@sunstarsys.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 19 Nov 2000 21:06:54 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Accessing windows terminal server
Message-Id: <8va0vu$g15@junior.apk.net>

In article <8v9e3k$sn3$1@nnrp1.deja.com>,  <luca_vertua@my-deja.com> wrote:
>Hi, I need to retrive data using a windows terminal server connection,
>perl may act as a client or may use some microsoft library to "emulate"
>client.    Any idea will be appreciated.

It's a little hard to understand what you're asking for here.

You can probably do what you're asking, using Perl.  But you'd probably
have to learn Perl in order to do it.

Maybe, just maybe, you will need the Net::Telnet module.  But I can't
tell.



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

Date: Mon, 20 Nov 2000 03:21:30 GMT
From: "Jason Kiss" <Please_reply@this.group>
Subject: Re: Can't run perl !!
Message-Id: <VM0S5.37930$wW2.1051200@news1.giganews.com>

Thanks Bart Lateur !!!!!
It worked !!!!!!!!!!!!!!!

:))))))

Wahhhhoooooooooooooooo!!!

Thank You so MUCH !!!!

Jason

"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:mp1g1tcq4hpb1uvma4e1duubolrcm6rj9d@4ax.com...
> Jason wrote:
>
> >Why can't I run perl??? If I change the .pl to .cgi work fine but if I
leave
> >it .pl it show all the text !!! My perl extention is fine, example:
> >#!/usr/bin/perl
> >It worked on other website but not my server ???
>
> I think it's the server configuration. If the server doesn't know that
> the .pl extension belongs to a script, then it'll simply treat it as a
> data file. What is strange, is that with the script set to execution
> file mode, and .pl not recognized as script, then I get a server error.
>
> If the server is Apache, and your server configuration allows it, then
> you can override the default behaviour in a .htaccess file:
>
> <files "*.pl">
> SetHandler cgi-script
> </files>
>
> --
> Bart.




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

Date: 19 Nov 2000 21:22:04 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Do I need Java to redirect form parameters?
Message-Id: <8va1sc$jka@junior.apk.net>

In article <3a175c4a@news.webaccess.net>,
Josh Whitt <jwhitt@webaccess.net> wrote:
>Alan Dougall (ntl) <abaltd@ntlworld.com> wrote in message
>news:BERQ5.2998$X03.50261@news2-win.server.ntlworld.com...
>
>> But how do I ensure that a page form parameters (with hidden values) are
>> automatically forwarded to the follow-up page without waiting/needing the
>> user to press the button on that page?
>>
>> Essentially, the first page asks for details.  After checking the details,
>> the second form "page" needs to forwards these to another site (not mine!)
>Hi, I'm Josh.  There are some options here:
>
>1) use a GET style URL to pass the parameters, if it's really not imperative
>that they be hidden:
>
>print redirect ("http://www.foo.bar/myperlprog?param1=nifty&param2=neato");
>
>2) print a page with some javascript to trigger the form submit immediately
>3) whip out LWP and post directly to this external script, grab that
>script's output, and print it out from your script.
>
>Option 3 would be the most seamless to the user, but option 2 would probably
>be the fastest.

Even though your Option 3 uses LWP, this is still really not a Perl
question.  The OP will get better answers on a CGI or site-design
newsgroup.



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

Date: 19 Nov 2000 21:50:42 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: File Extensions
Message-Id: <8va3i2$qku@junior.apk.net>

In article <3a16aac7@news.server.worldonline.co.uk>,
gazzaman <no-spam-gbat@gbat.screaming.net> wrote:
>As part of a college project I am creating WEB pages that call and execute
>perl scripts.
>
>When I save my perl scrips to cgi-bin with a .pl extension and they won't
>run.
>I save then to the same directory with a .cgi extension and they do.

Ding!  A clue dawns!

>What is wrong?

Whatever's wrong, it probably isn't a problem with Perl.

>Is it something that I can fix or does the server manager have to do it.

It is most likely a server configuration feature.  Consider going to your
friendly neighborhood search engine for "perl cgi idiots guide".  No,
really, it's a good document.

Bottom line, though, you do not have a Perl problem, you have a server
problem.  (And it's not a big problem at that.)



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

Date: Mon, 20 Nov 2000 12:36:14 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: File Extensions
Message-Id: <Ct0S5.22$Is1.2454@vic.nntp.telstra.net>

"gazzaman" <no-spam-gbat@gbat.screaming.net> wrote in message
news:3a16aac7@news.server.worldonline.co.uk...
> As part of a college project I am creating WEB pages that call and
execute
> perl scripts.
>
> When I save my perl scrips to cgi-bin with a .pl extension and they
won't
> run.
> I save then to the same directory with a .cgi extension and they do.
>
> What is wrong?

Nothing is "wrong"

> Is it something that I can fix or does the server manager have to do
it.
>

It is a server configuration issue.  So why not just call your script
*.cgi?

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";





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

Date: Mon, 20 Nov 2000 05:03:38 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Free Online Sample Certification Questions
Message-Id: <Kg2S5.597$Bf7.189853184@news.frii.net>

In article <974644437.557@itz.pp.sci.fi>,
Ilmari Karonen  <usenet11280@itz.pp.sci.fi> wrote:
>In article <8uur44012sc@news1.newsguy.com>, Jeff Yoak wrote:
>>In article <8uo399$7fa$1@nnrp1.deja.com>, cd_root@my-deja.com wrote:
>>
>>> Perl questions are located at:
>>> http://www.networkessentials.com/certified/perl
>>
>>This seemed pretty lame to me.  Probably a third of the questions I got
>
>It's not just the questions, the web interface is also broken.
>

My offer still stands.  Anyone who wants a Perl certification may recieve
one from me. I'll even email you the Postscript file so you can print it
your self.
-- 
    This space intentionally left blank


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

Date: 19 Nov 2000 23:45:02 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Getting Bold Font on plain ASCII
Message-Id: <8vaa8e$n2f@junior.apk.net>

In article <3A157A2C.D512D8F7@usgs.gov>,
William H. Asquith <wasquith@usgs.gov> wrote:
>I have a need to make some lines/words in plain ASCII files in bold face
>type.

That's self-contradictory.

If you have bold face type, it's not plain ASCII anymore.

>Perl is writting the text files already.  I need some guidance on
>how to make a font bold.  I don't mind writting either postscript or
>PDF.

Oh, well then it's not plain ASCII.  *sigh*

>I can write POD and use B<> and the markup tag, but the pod2pdf
>from Pod::Pdf overformats the file for me.  Do I have any alternatives?
>This seems like a very simple task, but I don't know suitable perl
>modules beyond Pod::Pdf.

What do you mean by "overformats"?

I have a couple of good books on PostScript.  The one closest at hand
is PostScript Language Reference, third edition, from Adobe Systems
Incorporated.  Get something like that and paint the town red.  Or
bold.



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

Date: Mon, 20 Nov 2000 02:13:18 -0800
From: "Mauro" <-@-.com>
Subject: how do I delete initial and final spaces in a string?
Message-Id: <8v9tq3$4ge$1@nslave3.tin.it>

I need to transform data like below:

input:
         fgdfgsdf fgdfgklh fgdfslhjfd           |     25,534
   fsdhj  asgh flhfsdhjklfda fsdhjlfd   |  543,432,344
      fdfsdg fsdgfsdg fdg fsdg f              |          344

output:
fgdfgsdf fgdfgklh fgdfslhjfd|25,534
fsdhj  asgh flhfsdhjklfda fsdhjlfd|543,432,344
fdfsdg fsdgfsdg fdg fsdg f|344

Using regexps it seems there isn't a way to perform it..
(please think on solution with fastest exec. time)

thanks all
Marco




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

Date: Mon, 20 Nov 2000 14:20:49 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <J%1S5.35$Is1.2465@vic.nntp.telstra.net>

"Mauro" <-@-.com> wrote in message news:8v9tq3$4ge$1@nslave3.tin.it...
> I need to transform data like below:
>
> input:
>          fgdfgsdf fgdfgklh fgdfslhjfd           |     25,534
>    fsdhj  asgh flhfsdhjklfda fsdhjlfd   |  543,432,344
>       fdfsdg fsdgfsdg fdg fsdg f              |          344
>
> output:
> fgdfgsdf fgdfgklh fgdfslhjfd|25,534
> fsdhj  asgh flhfsdhjklfda fsdhjlfd|543,432,344
> fdfsdg fsdgfsdg fdg fsdg f|344
>
> Using regexps it seems there isn't a way to perform it..
> (please think on solution with fastest exec. time)
>

Well, I would use a regex.

while (<DATA>){
    s/\s*(.*\S)\s*\|\s*(.*\S)\s*/$1|$2/;
    print "$_\n";
}

So similar to another thread I was just in.....

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";






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

Date: 20 Nov 2000 04:47:00 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <slrn91ggr2.sb9.trammell@nitz.hep.umn.edu>

On Mon, 20 Nov 2000 02:13:18 -0800, Mauro <-@-.com> wrote:
>I need to transform data like below:
>
>input:
>         fgdfgsdf fgdfgklh fgdfslhjfd           |     25,534
>   fsdhj  asgh flhfsdhjklfda fsdhjlfd   |  543,432,344
>      fdfsdg fsdgfsdg fdg fsdg f              |          344
>
>output:
>fgdfgsdf fgdfgklh fgdfslhjfd|25,534
>fsdhj  asgh flhfsdhjklfda fsdhjlfd|543,432,344
>fdfsdg fsdgfsdg fdg fsdg f|344

How about doing it in two steps:

    $line =~ s(^\s+)();
    $line =~ s(\s+\|\s+)(\|);

Of course this depends on "sdfgsdfg" not including "|", and
is kind of narky about those spaces.

-- 
John J. Trammell
johntrammell@yahoo.com


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

Date: 19 Nov 2000 23:23:39 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: i/o multi-serial ports
Message-Id: <8va90b$imk@junior.apk.net>

In article <3A160C77.963347A5@apperley.com>,
Douglas Apperley  <douglas@apperley.com> wrote:
>I have a 4 port serial board.  What syntax do I need to print to
>serial port 1 and serial port 2.  I have a scanner hooked up to
>serial port3.  How do I get input from the port3.

On Windows, try Win32::SerialPort and Win32API::CommPort.

On better systems, try Device::SerialPort.



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

Date: Sun, 19 Nov 2000 22:02:56 -0500
From: claudej <claudej@videotron.ca>
Subject: Is "use GD;" a standard Perl Modules or function ?
Message-Id: <B63DFE90.627A%claudej@videotron.ca>

I can't find it in my books.

If not, the following won't work

 .....
for ($i = 0; $i <= $digs; ++$i) {
$each_digit = @numbers[$i];
open (TILE,"$each_digit.gif") || die;
$tile = newFromGif GD::Image(TILE);
close TILE;
$im->setTile($tile);
$im->filledRectangle($startx,0,$endx,19,gdTiled);
$startx = $startx + 15;
$endx = $endx + 15;
}
 ......
print $im->gif;
 .....

Using only the standard Perl Modules or functions how can I
make a .gif from a few small ones ? I can send only one.

P.S. Mark W. Schumann << Sorry, that my previous question wasn't so clear.



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

Date: Mon, 20 Nov 2000 04:26:38 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Is "use GD;" a standard Perl Modules or function ?
Message-Id: <2K1S5.596$Bf7.190324736@news.frii.net>

In article <B63DFE90.627A%claudej@videotron.ca>,
claudej  <claudej@videotron.ca> wrote:
>
>Using only the standard Perl Modules or functions how can I
>make a .gif from a few small ones ? I can send only one.
>

The GD library is not part of the CORE modules but I think that it
ships bundled with the Activestate packages.  GD is pretty low level
too.  You might be more interested in the PerlMagic modules based
in the ImageMagic utilities. They have higher level functions for
merging, composing and manipulating whole images
-- 
    This space intentionally left blank


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

Date: Sun, 19 Nov 2000 21:22:12 -0700
From: Daniel Cuaron <dcuaron@cs.nmsu.edu>
Subject: just testing
Message-Id: <3A18A6F4.620AAAC4@cs.nmsu.edu>

  this is a test



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

Date: Sun, 19 Nov 2000 21:20:23 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Illiterate
Message-Id: <slrn91h2j7.al3.tadmc@magna.metronet.com>

On Sun, 19 Nov 2000 18:52:25 -0600, Matt Miller 
   <repentandspamnomoremillerdg@mindspring.com> wrote:

>What is perl?


A programming language.

What would you expect for a newsgroup with "comp.lang" in its name?


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 19 Nov 2000 21:20:26 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: PerlScript and ASP
Message-Id: <m31yw7tmdx.fsf@mumonkan.sunstarsys.com>

catfood@apk.net (Mark W. Schumann) writes:

> In article <8v9vkb$i5n$1@samba.rahul.net>,
> Todd McLaughlin  <toddm@waltz.rahul.net> wrote:
> >The folowing code lets me store a value in the application data.  How do I
> >do this if I want to store an array instead of a single value?  Say I had
> >@var1 instead of $var1. 
> 
> $ man perldata
> 
> One example:
> 
> @var1 = ('one thing', 'another', 0xdeadbeef, {1,2,3});
                                               ^^^^^^^
ITYM [1,2,3] here.

-- 
Joe Schaefer


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

Date: 19 Nov 2000 21:40:47 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: print "Location: revised
Message-Id: <8va2vf$o4u@junior.apk.net>

In article <3A16E0F5.3BDB09B6@mrnoitall.com>,
Todd Anderson  <todd@mrnoitall.com> wrote:
>I am trying to write a script that would be run by cron. I'm not sure of
>how to prompt another scipt on another server.

Neither am I.  Go on...

>In otherwords, I can put this line...
>http://my.com/?Add2&Login=name&password=name&DomainID=678679
>in my url finder and it works. I want to do the same thing with the
>script...

Ah.  But cron is not an HTTP client.

>Thanks in advance for your help
>
> #!/usr/bin/perl
> open(LIST,"names.txt");
> @array=<LIST>;
> close(LIST);
> $number = "0";
> foreach $name (@array ) {
> $number ++;
> chomp($name);
>#code in question....
> print "Location:
>http://my.com/?Add2&Login=$name&password=$name&DomainID=678679";
>  sleep(3);
> }
> print qq~Success~;

One step at a time.  When you run this from the command line, what does
it do?  (That's rhetorical, I know what it does.)  Now ask yourself why
it does that.  That's what ``print'' does.  Note that ``print'' is not
an HTTP client either.

If you're trying to talk to an HTTP server, consider using an HTTP
client.  CPAN has at least one or two of them.



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

Date: 19 Nov 2000 23:19:42 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Reading Serial ports?
Message-Id: <8va8ou$hq0@junior.apk.net>

In article <3A16A368.D603CB4D@watford53.freeserve.co.uk>,
Jim Ford  <jaford@watford53.freeserve.co.uk> wrote:
>I would like to attach some hardware to (say) one of the control lines
>of a serial port, such that I can count the number of times it 'wiggles'
>up and down. I'd also like to do it in Perl.
>
>Has anyone any ideas or pointers, please?

On Windows platforms, try Win32::SerialPort and Win32API::CommPort.

On better platforms, try Device::SerialPort.

All available at your friendly neighborhood CPAN.



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

Date: Sun, 19 Nov 2000 20:03:40 -0800
From: Stuart Vigne <vigne@nhamp.net>
Subject: rearranging a text file
Message-Id: <DD5F4E269FD2FFA8.8ACF7244F2B12DA1.139E2C712354EA39@lp.airnews.net>

I am really new to perl, and came across a problem that my two how-to
books can't help me with.  

I have a text file that has 12 lines (could be more or less) at the
top, and an equal number of lines at the bottom.  There is a blank
line between the 24 lines I want to rearrange.  There are a total of
25 lines this file.

Using this 25 line file as an example...I want to take line #1 and
print it out with line #14 immediately to its right on the same line.
Ditto for line #2 & 15, #3 & 16, and so on.

I hope this is enough information.  Thanks in advance.

-Stu


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

Date: Mon, 20 Nov 2000 14:38:44 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: rearranging a text file
Message-Id: <sg2S5.39$Is1.2612@vic.nntp.telstra.net>

"Stuart Vigne" <vigne@nhamp.net> wrote in message
news:DD5F4E269FD2FFA8.8ACF7244F2B12DA1.139E2C712354EA39@lp.airnews.net..
 .
> I am really new to perl, and came across a problem that my two how-to
> books can't help me with.
>
> I have a text file that has 12 lines (could be more or less) at the
> top, and an equal number of lines at the bottom.  There is a blank
> line between the 24 lines I want to rearrange.  There are a total of
> 25 lines this file.
>
> Using this 25 line file as an example...I want to take line #1 and
> print it out with line #14 immediately to its right on the same line.
> Ditto for line #2 & 15, #3 & 16, and so on.
>

Ask and ye shall receive:
#!/usr/bin/perl -w
use strict;

my (@array1, @array2);
my $first = 0;
while (<DATA>){
chomp;
if (/^\s*$/){
$first = 1;
next;
}
if ($first ==

push @array1,$_;
}
else{
push @array2,$_;
}
}

my $i = 0;
for (@array1){
print "$array1[$i] $array2[$i]\n";
$i++;
}

__END__
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12

Line 14
Line 15
Line 16
Line 17
Line 18
Line 19
Line 20
Line 21
Line 22
Line 23
Line 24
Line 25



Note this makes lots of nasty assumptions about the reliability of your
data.

$100 thanks :)

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";









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

Date: Mon, 20 Nov 2000 14:39:59 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: rearranging a text file
Message-Id: <Dh2S5.40$Is1.2533@vic.nntp.telstra.net>


"Wyzelli" <wyzelli@yahoo.com> wrote in message
news:sg2S5.39$Is1.2612@vic.nntp.telstra.net...
> next;
> }
> if ($first ==

if ($first == 0){

> push @array1,$_;
> }

Dunno why but OE5 keeps screwing that part of the original post.

Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: 19 Nov 2000 21:48:17 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Send a form to a script AND email/file
Message-Id: <8va3dh$q0g@junior.apk.net>

In article <8v6adf$n6k$1@nnrp1.deja.com>,  <meniac@my-deja.com> wrote:
>I have a form on my site where the data is send to a remote hosted
>script, and I have no access to make changes in that.
>
>I would like to have one of the fields information saved to a file on
>my own server when the user submit the form, or if that can't be done
>have the field information emailed to me.

Okay.

>Are any of this possible?

You're not giving out a lot of information here, but if I'm
understanding your question correctly you probably need to have access
to create/modify CGI scripts on some server, somewhere.

What I can tell from your question is that it has nothing at all to do
with Perl.  You might want to try one of the site-design or CGI
newsgroups or their respective FAQs for the right answer.



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

Date: 19 Nov 2000 21:17:32 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: sendmail with cgi.pm?
Message-Id: <8va1js$ii3@junior.apk.net>

In article <8v97mg$o12$1@nnrp1.deja.com>,  <xlr6drone@my-deja.com> wrote:
>There is nothing  in the server error logs.  I don't know how to
>redirect to an error log file.
>
>The script prints the user input to a guestbook.txt file but it never
>sends the email  with the  variables to my address below.  No
>errors appear in the browser either.
>
>print MAIL "To: lexmesa\@mindspring.com\n";
>print MAIL "From: test@\mail.com\n";
>print MAIL "Subject: $subject\n\n";
>print MAIL "$location\n\n";

You had this:
> open (MAIL, "|/usr/lib/sendmail -t") || &ErrorMessage("error opening sendmail");

Consider this:
> open (MAIL, "|/usr/lib/sendmail -t 2>$ERROR_FILE_NAME") || &ErrorMessage("error opening sendmail");

where of course you've defined $ERROR_FILE_NAME previosuly.

Failing that, have you tried the debug mode that CGI.pm offers?  That
can be *extremely* helpful.

Finally, you might want to trap SIG{PIPE} too.



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

Date: 19 Nov 2000 21:43:41 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: simple perl script question
Message-Id: <8va34t$orv@junior.apk.net>

In article <8v6c0l$oe3$1@nnrp1.deja.com>,  <james_offer@my-deja.com> wrote:
>I'm sure there is a way to do this, but I don't know how - I have very
>little experience in Perl. Anyway, how would I go about creating a Perl
>script that contains some basic HTML and pass a variable into it to
>display a picture for example?
>
>i.e.:
>
>display.pl?picture=myphoto.jpg
>
>The end result a basic HTML page with the photo link dynamically
>generated. I really don't want to be stuck with 100s of individual HTML
>files and Perl is the only scripting language I have access too at this
>moment in time.
>
>Any suggestions?

Yes.  Read a good tutorial on CGI, because that's what you're trying to
do.  While you can use Perl to implement CGI, it's not really a Perl
topic in itself.

A web search for "idiots guide perl cgi" will yield generous results.
No, really, try it.



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

Date: 19 Nov 2000 21:12:43 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: still broken
Message-Id: <8va1ar$hbb@junior.apk.net>

In article <8v999v$nd7$1@bob.news.rcn.net>,
David Marvil <captmarvil@rcn.com> wrote:
>I hope I am not posting improperly by posting this issue again. If I am I
>appologize.

You're posting improperly by doing it "Jeopardy style."  Please let the
conversation start at the top of the page and go down to the bottom, as
is common in Western cultures.

>I am still having difficulty in getting this script to work. I can't get any
>values to print using eq if I use = I can get a value for $user but I can't
>get a value for $a. I am not sure if I am am supposed to have a $ in front
>of
>name on line 11, I have tried both with and without. I have also moved the
>the quotes around. Thanks.

Sounds like you've gone over to voodoo programming.

Make sure you read "man perldat" to get a grip on what hashes are!
It doesn't look like it to you, but there is no such variable as
$a in your program.  It's actually a hash named %a.

As a hint, the if statement near the end is really not the right way
to do it.  The hash %a will have, at that point, something like this
in it:

  KEYS                 VALUES
  "catfood smith"  --> "1.2.3.4"
  "ben gay"        --> "10.1.1.1"
  "john lithgow"   --> "0.0.0.0"

Now that's about as much as I'm going to write about hashes, since it's
all explained right there in the documentation.  Read up on hashes, apply
it to your case, and let us know if you have specific questions on how
to use 'em.

>"Wyzelli" <wyzelli@yahoo.com> wrote in message
>news:yZGR5.6$dm1.2290@vic.nntp.telstra.net...
>> "David Marvil" <captmarvil@rcn.com> wrote in message
>> news:8v75dn$jba$1@bob.news.rcn.net...
>> > #! /usr/bin/perl -w
>> > print "Enter users name: ";
>> > chomp  ($user = <STDIN>);
>> > open (FILE, "/user_info") || die "File not found";
>> > while (<FILE>) {
>> > chomp;
>> > ($name, $ip) = /(\w+\s+\w+)\s+(\d+\.\d+\.\d+\.\d+)/;
>> > $a{$name} = $ip;
>> > }
>>
>> if ($name eq $user){
>>     print "$user\t"$a{name};
>> }
>>
>> Hope that helps
>>
>> Wyzelli
>> --
>> #Modified from the original by Jim Menard
>> for(reverse(1..100)){$s=($_==1)? '':'s';print"$_ bottle$s of beer on the
>> wall,\n";
>> print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
>> $_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
>> wall\n\n";}print'*burp*';
>>
>>
>
>
>




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

Date: Mon, 20 Nov 2000 03:27:25 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: STOP REPEATED POSTING! Re: Problems saving an uploaded file.
Message-Id: <m3r947s4pv.fsf@solo.david-steuber.com>

dtbaker_dejanews@my-deja.com writes:

' I answered one of your many earlier threads.... please STOP re-posting.

Judging from the headers, I would say there is a problem with the news
server.  Based on someone else's post, the admin for that box is
ignoring complaints.

I suspect the message is staying in the outgoing spool even after
being sent.  The admin needs to go into the spool and delete the file
or we will see this message until doomsday.

All the message ids are different (hence the repeating propogation).
They are not assigned my the news client software.  Microsoft likes to
use funky IDs.  That is a news server assigned ID.

Someone needs to talk to ericsson rather directly.  Perhaps Johan
Ditmar should tell them since he claims to work for them.  It should
be as simple as picking up the phone.  Ericsoson has phones, don't
they? ;-)

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: Sun, 19 Nov 2000 22:26:32 -0500
From: Matt <softh@bellsouth.net>
Subject: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <3A1899E8.2A52537A@bellsouth.net>

This is a multi-part message in MIME format.
--------------34413B54C4259A7771569136
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi all,

I guess I am showing my ignorance but I hit this tonight while playing
with a localtime() parsing script to determine dates for use in an array
I will need to filter posted articles. This script is really butt
simple  and I am sure there is an easier/better way to do this but this
was a fairly quick way to do what I needed for now. But dang if things
don't seem to fall apart on/around Halloween 2000. This especially odd
because the string went from 9 characters to 10 in September and Oct 01
generates fine. I have'nt palyed with it day by day or hour by hour ....
but I though I would post my results so far. Check out the url or code
and data included below. Any ideas on waht is happening here?
TIA
Matt

matt@everyquest.net
or
softh@bellsouth.net


The url:#########################################################


http://everyquest.net/cgi-bin/util/dateq.cgi


The script:#########################################################

#!/usr/bin/perl

#############################################
## Date: 10/24/2000
## EveryQuest Version 2.0 Date Query
## Copyright 10/24/2000 Matthew Hill | EveryQuest
http://www.everyquest.net
## matt@everyquest.net  All rights reserved.
##
## This is a little script that parses a delimited flat database file of
date strings into human readable date format.
## This is FREE and OPEN SOURCE software released under the GPL.
##

 print "<body bgcolor=#000000>
 <hr>
 <font color=FFBB00><h3>Local Time Date Parser US Central Time - 6 hrs
Greenwhich</h3></font>
 <hr>";

 &oops('There was an error opening the Date file') unless
 (open(DATEFILE, "datefile.dat"));
 while (<DATEFILE>)  {
 ($DateString, $Interval) = split(/::/, $_ );
 {$Date=localtime($DateString)};
 print "<dt> <font color=FFBB00> $DateString  $Interval </font> </dt>
<dd> <font color=00FF00> $Date </font> </dd> <hr>";
 }

 close DATEFILE;

The Data File
###########################################################

000000000::+0
000000060::+1 minute
000003600::+1 hour
000021600::+6 hours
000043200::+12 hours
000086400::+1 day
002629800::+1 month (365/12)
031557600::+1 year (365.25)
063115200::+2 years
094672800::+3 years
126230400::+4 years
157788000::+5 years
189345600::+6 years
220903200::+7 years
252460800::+8 years
284018400::+9 years
315576000::+10 years
347133600::+11 years
378691200::+12 years
410248800::+13 years
441806400::+14 years
473364000::+15 years
504921600::+16 years
536479200::+17 years
568036800::+18 years
599594400::+19 years
631152000::+20 years
662709600::+21 years
694267200::+22 years
725824800::+23 years
757382400::+24 years
788940000::+25 years
820497600::+26 years
852055200::+27 years
883612800::+28 years
915170400::+29 years
946728000::+30 years
946706401::+30 years 2000 New Year Time
978285600::+31 years
978328801::+31 years 2001 Jan 01 New Year Time
981007201::+31 years 2001 Feb 01 (86400x31=2678400)
983426401::+31 years 2001 Mar 01 (86400x28=2419200)
986104801::+31 years 2001 Apr 01 (86400x31=2678400)
988696801::+31 years 2001 May 01 (86400x30=2592000)
991375201::+31 years 2001 Jun 01 (86400x31=2678400)
993967201::+31 years 2001 Jul 01 (86400x30=2592000)
996645601::+31 years 2001 Aug 01 (86400x31=2678400)
999324001::+31 years 2001 Sep 01 (86400x31=2678400)
1001916001::+31 years 2001 Oct 01 (86400x30=2592000)
1004594001::+31 years 2001 Nov 01 (86400x31=2678400)
1007186001::+31 years 2001 Dec 01 (86400x30=2592000)
1009843000::+32 years
1009843001::+32 years 2002 New Year Time
1041401000::+33 years
1041401001::+33 years 2003 New Year Time
1072959000::+34 years
1072959001::+34 years 2004 New Year Time
1104517000::+35 years
1104517001::+35 years 2005 New Year Time


--------------34413B54C4259A7771569136
Content-Type: text/x-vcard; charset=us-ascii;
 name="softh.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Matt
Content-Disposition: attachment;
 filename="softh.vcf"

begin:vcard 
n:Hill;Matthew
x-mozilla-html:TRUE
url:everyquest.net
org:EveryQuest.Net
adr:;;address confidental for now;Manitou;Ky;;
version:2.1
email;internet:matt@everyquest.net
title:COO
fn:Matt
end:vcard

--------------34413B54C4259A7771569136--



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

Date: 19 Nov 2000 23:49:27 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <m3snons0x4.fsf@mumonkan.sunstarsys.com>

Matt <softh@bellsouth.net> writes:

> Hi all,
> 
> I guess I am showing my ignorance but I hit this tonight while playing
> with a localtime() parsing script to determine dates for use in an array
> I will need to filter posted articles. This script is really butt
> simple  and I am sure there is an easier/better way to do this but this
> was a fairly quick way to do what I needed for now. But dang if things
> don't seem to fall apart on/around Halloween 2000. 

What specifically do you mean by "fall apart"?
I don't see any Oct 2000 dates in your data file.

> Any ideas on waht is happening here?  TIA

None at all. What happens if you try this snippet on your data:

==========
#!/usr/bin/perl -wT
while (<DATA>)  {
  my ($DateString, $Interval) = split(/::/, $_ );
  my $Date=localtime($DateString);
  print "$DateString  $Interval $Date \n";
}

_DATA__

000000000::+0
000000060::+1 minute
000003600::+1 hour
000021600::+6 hours
000043200::+12 hours
000086400::+1 day
[...]
==========

Do you still see a problem? (Run the code directly,
*not* via your browser/webserver.)

--
Joe Schaefer


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

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


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