[12103] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5703 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 17 16:07:13 1999

Date: Mon, 17 May 99 13:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 17 May 1999     Volume: 8 Number: 5703

Today's topics:
    Re: -> Folkert Meeuw: Value  of <HANDLE> can be "0"; te <ebohlman@netcom.com>
    Re: -> Folkert Meeuw: Value of <HANDLE> can be "0"; tes <montanab@gower.net>
    Re: A Perl Script <lone.wolf@net.ntl.com>
    Re: A Perl Script <ebohlman@netcom.com>
        Bug or feature? (Marko R. Riedel)
        creating raw sockets with pack (Corey Saltiel)
        DCE-Perl Module <jardolin@zoo.uvm.edu>
    Re: Error message when reading a file <ebohlman@netcom.com>
    Re: fetching specific info from a text file <tony@smee.demon.co.uk>
    Re: getopts <ebohlman@netcom.com>
    Re: getopts <cassell@mail.cor.epa.gov>
    Re: how to free a Socket <tony@smee.demon.co.uk>
        negative subscripts (Thomas Wade Vaughan)
    Re: Occasional user <cassell@mail.cor.epa.gov>
    Re: Occasional user <giroux@dms.umontreal.ca>
    Re: Occasional user <giroux@dms.umontreal.ca>
    Re: Occasional user <giroux@dms.umontreal.ca>
    Re: Occasional user <giroux@dms.umontreal.ca>
    Re: Occasional user <giroux@dms.umontreal.ca>
    Re: OOP and Perl-a good book? <aqumsieh@matrox.com>
        Perl / Sybase Opening <mlewis@worldnetcorp.com>
        Reading in a file and outputting to browser elvis@NOTGRACELANDclark.net
    Re: Reading in a file and outputting to browser elvis@NOTGRACELANDclark.net
        Reg Exp Q! <bill@fccj.org>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 17 May 1999 18:59:14 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: -> Folkert Meeuw: Value  of <HANDLE> can be "0"; test with defined()
Message-Id: <ebohlmanFBw4qq.Hvy@netcom.com>

Folkert Meeuw <fmee@lfi.uni-hannover.de> wrote:
: #!/usr/local/bin/perl -w
: # 1.6 Files read

: open (IN, "friends");
: while ($line = <IN>)
: {
:  chomp ($line);
:  push (@friends, $lines);
: }
: close IN;

: when I try to execute it in a shell, I will get this:

: perl -w 1.6.pl
: Value of <HANDLE> construct can be "0"; test with defined() at 1.6.pl
: line 5.

perl 5.004 gives you a warning in this case because in it (and earlier 
versions too, but they didn't give a warning) the loop could terminate 
prematurely under certain (rare) circumstances; this can be fixed by 
changing the line to:
 
while (defined($line=<IN>)) {

perl 5.005 compiles your original statement to the equivalent of the above.

: Name "main::friends" used only once: possible typo at 1.6.pl line 8.

That's because you assigned to it but never did anything with its contents.

: Name "main::lines" used only once: possible typo at 1.6.pl line 8.

That's because you wrote $lines when you meant to write $line.


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

Date: Mon, 17 May 1999 14:19:33 GMT
From: Bill Montana <montanab@gower.net>
Subject: Re: -> Folkert Meeuw: Value of <HANDLE> can be "0"; test with defined()
Message-Id: <19990517.14193357@bill.montana.net>

I'm no perl expert, just a newbie. But these look like only warnings=20=

to me. Using the -w flag causes perl to list things that could=20
POSSIBLY cause problems in your code. This doesn't mean the code will=20=

not work. However, there IS a typo in line 8: $lines should be $line.=20=

Note that this code doesn't provide any output. So you won't even know=20=

if it works when it does. Add some code at the end to print out=20
@friends. This will do the trick:

$i =3D 0;

while ($i++ < @friends)
{
 print "$friends[$i]\n";
}

I'm sure there are other ways, but, as I said, I'm a newbie.

HTH,
Bill Montana

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 5-17-99, 4:43:25 PM, Folkert Meeuw <fmee@lfi.uni-hannover.de> wrote=20=

regarding -> Folkert Meeuw: Value of <HANDLE> can be "0"; test with=20
defined():


> Hi Dear Friendly Readers,

> I 've got a problem in perl.

> #!/usr/local/bin/perl -w
> # 1.6 Files read

> open (IN, "friends");
> while ($line =3D <IN>)
> {
>  chomp ($line);
>  push (@friends, $lines);
> }
> close IN;

> when I try to execute it in a shell, I will get this:

> perl -w 1.6.pl
> Value of <HANDLE> construct can be "0"; test with defined() at 1.6.pl=

> line 5.
> Name "main::friends" used only once: possible typo at 1.6.pl line 8.
> Name "main::lines" used only once: possible typo at 1.6.pl line 8.


> The file "friends" contents names of friends, in each line one name.
> Who knows ?

> NG Folkert Meeuw





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

Date: Mon, 17 May 1999 21:01:00 +0100
From: "Lone Wolf" <lone.wolf@net.ntl.com>
Subject: Re: A Perl Script
Message-Id: <37406535.0@145.227.194.253>

Or could someone send me a "REALLY" simple .pl program that should run on
any server, or is already tailored for my IIS server.

Thanks

Lone Wolf wrote in message <3740587d.0@145.227.194.253>...
>The books I have must be so full of rubbish :-
>
>Can someone explain to me WHY this will not run on my Microsoft IIS 4
>server?
>
>print "HTTP/1.0 200 OK\n\n";
>print "Content-Type: text/html\n\n";
>print "<HTML>\n";
>print "<HEAD>\n";
>print "<TITLE>Hello World</TITLE>\n";
>print "</HEAD>\n";
>print "<BODY>\n";
>print "<H4>Hello World</H4>\n";
>print "<P>\n";
>print "Your IP Address is $ENV{REMOTE_ADDR}.\n";
>print "</P>\n";
>print "<H5>Have a nice day</H5>\n";
>print "</BODY>\n";
>print "</HTML>\n";
>
>I keep getting the error message :-
>CGI Error
>The specified CGI application misbehaved by not returning a complete set of
>HTTP headers. The headers it did return are:
>
>And thats all I get back.
>
>Thanks for shedding any light.
>
>




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

Date: Mon, 17 May 1999 19:04:10 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: A Perl Script
Message-Id: <ebohlmanFBw4yz.IAK@netcom.com>

Lone Wolf <lone.wolf@net.ntl.com> wrote:
: The books I have must be so full of rubbish :-

: Can someone explain to me WHY this will not run on my Microsoft IIS 4
: server?

: print "HTTP/1.0 200 OK\n\n";

That double newline marks the end of your headers.

: print "Content-Type: text/html\n\n";

Even though you aren't finished sending them
: print "<HTML>\n";
: print "<HEAD>\n";

[snip]

Take a look at perlop, in the section about quoting operators, and read 
up on "here documents" to learn a much more readable and maintainable way 
to do this sort of thing.



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

Date: 17 May 1999 20:59:56 +0200
From: mriedel@neuearbeit.de (Marko R. Riedel)
Subject: Bug or feature?
Message-Id: <lzwvy7v7wy.fsf@linux_sexi.neuearbeit.de>


I am using perl5.005_02. The program shown below crashes my Linux box
when invoked with arguments >=16 by using up all available swap
space. (About 70Mb.)

#! /usr/bin/perl -w

$|=1; 

$size=1<<(shift || 0);

@test=map { 
  my (@alloc)=(int(rand(1<<16)), int(rand(1<<16)));
  \@alloc 
} (1..$size); 

foreach(sort @test){
  print "@$_\n"; 
};

This is because the default comparison operator converts the pointers
that the array contains to strings in order to compare them
lexically. That is what it is supposed to do. These strings persist
until the sort has completed, however. Should they? The cmp operator
allocates two new strings every time it is invoked with e.g. pointer
operands.

Example. The array contains 65536 entries. Say quicksort makes
approximately 2 n log n comparisons. The lexical representation of a
pointer is 16 bytes long.

Result. To sort 64K of pointers requires 64Mb (!) of swap space.

Here is cmp.

I32
sv_cmp(register SV *str1, register SV *str2)
{
    STRLEN cur1 = 0;
    char *pv1 = str1 ? SvPV(str1, cur1) : (char *) NULL;
    STRLEN cur2 = 0;
    char *pv2 = str2 ? SvPV(str2, cur2) : (char *) NULL;
    I32 retval;

    if (!cur1)
	return cur2 ? -1 : 0;

    if (!cur2)
	return 1;

    retval = memcmp((void*)pv1, (void*)pv2, cur1 < cur2 ? cur1 : cur2);

    if (retval)
	return retval < 0 ? -1 : 1;

    if (cur1 == cur2)
	return 0;
    else
	return cur1 < cur2 ? -1 : 1;
}

The two strings are allocated through SvPV and do not form part of the
user's data space. I believe they shouldn't persist after sv_cmp
returns, especially since there are never used more than once.

Comments, anyone? (I am not sure how to evaluate the overhead that a
repeated del_SV would introduce. I understand that pointers may be
compared with <=>.)


Marko R. Riedel



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

Date: Mon, 17 May 1999 19:18:24 GMT
From: corey@americanrecruitment.com (Corey Saltiel)
Subject: creating raw sockets with pack
Message-Id: <slrn7k0qsk.ar.corey@scanner.helfrich.com>


Greetings,

  I'm a complete novice to network socket programming and would like
  to learn using perl.  I'm pretty confident as a perl programmer,
  and where/how/which docs to read for info - but I could really use
  some pointers on the creation of raw headers/ ip packets.  Looking
  at the net modules code with the standard lib in perl I see the
  use of the 'pack' function, however reading 'perldoc -f pack' leaves
  me totally in the dust, as it does nothing to explain to explain
  the purpose/method of it's use in the creation of raw sockets.

  If anyone would be so kind as to give me an example of some code generating
  a standard ip header and explaining it - I would appreciate it emmensely.

  Or even just giving me some pointers to any perl related documentation on
  this specific topic.

  Thanks a bunch.


Beers,

Corey

--

   "Remember that the P in Perl stands for Practical.
   The P in Python doesn't seem to stand for anything."
      -- Randal Schwartz


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

Date: Mon, 17 May 1999 15:56:36 -0400
From: "Joseph A. Ardolino" <jardolin@zoo.uvm.edu>
Subject: DCE-Perl Module
Message-Id: <37407474.FD0A425D@zoo.uvm.edu>

Hello:

Does anyone know if the DCE-Perl module(s) have been ported/patched for
AIX 4.x?  
Please reply to my email directly.

Thank you in advance, 

Joe.


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

Date: Mon, 17 May 1999 19:02:00 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Error message when reading a file
Message-Id: <ebohlmanFBw4vC.I6p@netcom.com>

tcpeter@my-dejanews.com wrote:
: I'm getting an error when trying to read through a list of individual
: files in a directory.  I know I could do this with a glob, but I get
: even more undecipherable errors when I try that.  I'm trying to find
: specific text in multiple files in a directory.  Ultimately, I want to
: write the filenames containing the matching text into a file.

: The error is "Couldn't open . : Permission denied."

You're forgetting that readdir() returns the names of both files and 
directories (including the '.' and '..' pseudo-directories found in every 
directory).  Your code needs to check which is which.



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

Date: Mon, 17 May 1999 20:04:27 +0100
From: Tony Smith <tony@smee.demon.co.uk>
To: Brian Altman <ba@iamd.com>
Subject: Re: fetching specific info from a text file
Message-Id: <3740683B.B01F6D40@smee.demon.co.uk>

Brian Altman wrote:

> Hi there,
>
> I am just beginning to learn how to program in Perl.
> Right now I am wondering if it is possible to 'get' specific data from an
> existing file (any text based file), and write it to a new file.
>
> Can someone help me with this ?
> Thanks a lot in advance !!

Have a look at this first, then it's time to read that documentation ;-)

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

my $infile = "input_filename";
my $outfile = "output_filename";

open(IN, $infile) or croak("Failed to open input file");
open(OUT, ">$outfile") or croak("Failed to open output file");

while (<IN>)
{
    print(OUT) if ( /regular expression/ );
}

close(IN);
close(OUT);

Good Luck,

Tony.

--
================================================================
Tony Smith
tony@smee.demon.co.uk
Reply address is corrupted to prevent spam. Remove
the spurious underscore to reply.
================================================================






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

Date: Mon, 17 May 1999 19:10:44 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: getopts
Message-Id: <ebohlmanFBw59x.Iwn@netcom.com>

bing-du@tamu.edu wrote:
: Can anybody tell me what the following getopts function does?  Thank
: you?  ('i','s','u' are options).  'perldoc -f getopts' told me No
: documentation for perl function `getopts' found

That's because getopts isn't a built-in Perl function; it's part of the 
Getopt::Std module.  'perldoc Getopt::Std' should tell you all you want 
to know.



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

Date: Mon, 17 May 1999 12:17:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: getopts
Message-Id: <37406B3A.4175D746@mail.cor.epa.gov>

bing-du@tamu.edu wrote:
> 
> Can anybody tell me what the following getopts function does?  Thank
> you?  ('i','s','u' are options).  'perldoc -f getopts' told me No
> documentation for perl function `getopts' found

That's because getopts() is imported from the module Getopt::Std,
instead of being a built-in.  Only the built-in functions are
in perlfunc.  Only functions in perlfunc show up when using the
perldoc -f option.

[Theatrical aside: "It looks like TomC might be right after
all about the multiplicity of perldoc uses!  Curses!"]

> if (getopts('isu', \%opt) == 0) {
>   print $usage_msg;
>   exit 1;
> }

Pull up the info on Getopt::Std and you'll see.
perldoc -MGetopt::Std 
will do it.  You'll see that this is checking to find out
if any of the legal options has been given.  If not,
print the 'usage message' which tells what the proper options
are, then exit with a status of '1'.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 20:16:48 +0100
From: Tony Smith <tony@smee.demon.co.uk>
To: Sebastian.Ahrens@ruhr-uni-bochum.de
Subject: Re: how to free a Socket
Message-Id: <37406B20.E515D369@smee.demon.co.uk>

Sebastian Ahrens wrote:

> I am using IO::Socket and IO::Select for a server-application. Now
> obviously a used socket is not freed immediately, because after a
> control-d and a restart of the server-app the handle for the socket is
> not valid -- I get this error:
>
> Can't use an undefined value as a symbol reference at
> /usr/local/lib/perl5/5.00502/sun4-solaris/IO/Select.pm line 57, <> chunk
> 1.
>
> Now after a certain period of time (always changing!) I am able to
> restart the program, which indicates the blocked socket is freed by the
> system (Solaris 7 on an Unltra Sparc).
>
> How can I get control over the freeing of a once used socket?
>
> Could anyone point me into the right direction?
>
> regards
>
>                     -Sebastian-

When a socket is closed, it enters a state called TIME_WAIT. This state is
intended to hold the socket open for (2 minutes by default??) to prevent too
rapid a restart. That's necessary because the other end may have
retransmitted its latest packet due to non-arrival of the last ACK.

I don't have IO::Socket et. al. on my box at the moment but if you want to
enable an immediate restart, then look for a socket option SO_REUSEADDR
(well that's the C constant name anyhow!). I don't claim to be an expert
though, so perhaps someone else could point out the pros/cons of this
approach.

Tony

*  TCP_TIME_WAIT       timeout to catch resent junk before entering
*              closed, can only be entered from FIN_WAIT2
*              or CLOSING.  Required because the other end
*              may not have gotten our last ACK causing it
*              to retransmit the data packet (which we ignore)


--
================================================================
Tony Smith
tony@smee.demon.co.uk
Reply address is corrupted to prevent spam. Remove
the spurious underscore to reply.
================================================================





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

Date: 17 May 1999 18:53:35 GMT
From: vaughan@well.com (Thomas Wade Vaughan)
Subject: negative subscripts
Message-Id: <7hpojf$3v0$1@its.hooked.net>

A co-worker wanted to know if we could start the index of an array
with a negative value. Initially I said no, but later thought of
changing the $[ variable to -5. This seemed to work until I put the 
array in a for loop and the behavior was what I thought a negative
index should be. I mean the array was indexed from the end.  Is this
bug or what.? I agree that I have no need to start an array index off 
with a negative value, but what is going on here where it works correctly
before the for loop.

Tom

#!/bin/perl

$[=-5;

@array=(1..10);
print "@array\n";

print "Last element $#array , -5 the 1st element is $array[-5]\n";
print "Last element $#array , -4 the 2nd element is $array[-4]\n";
for($i=-5;$i<=$#array;$i++)
{
	print "i = $i $array[$i]\n";
}



Output:


	1 2 3 4 5 6 7 8 9 10
	Last element 4 , -5 the 1st element is 1
	Last element 4 , -4 the 2nd element is 2
	i = -5 6
	i = -4 7
	i = -3 8
	i = -2 9
	i = -1 10
	i = 0 1
	i = 1 7
	i = 2 8
	i = 3 9
	i = 4 10



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

Date: Mon, 17 May 1999 12:07:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Occasional user
Message-Id: <374068E9.33CC8C0C@mail.cor.epa.gov>

Andre Giroux wrote:
> 
> Bart Lateur a icrit :
> 
> > Andre Giroux wrote:
> >
> > >I am trying to convert a eps file into a pdf  file using a perl script
> > >(file created by Mathematica and to be included  in a pdf document).
> >
> > I guess that's the EPS file, not the Perl script. The script probably
> > serves to do some processing on the file?
> >
> > >Working on wintel, I downloaded perl and put my script in
> > >c:\perl\bin .
> >
> > Bad place. Only stuff belonging to Perl itself should go there.
> >
> > >The question is : what should I do next ? (Or is it : what should I have
> > >done before ? )
> > >A lost mathematician.
> >
> > I guess you need to invoke the script with a command line like:
> >
> >         perl script.pl thatfile.eps
> >
> > where script.pl is the path to the script, and thatfile.eps is the path
> > to the epsfile.
> >
> > My guess is that it's best to put the script next to the eps file, go to
> > the DOS prompt, chdir to that directory, and run the script with the
> > bare file names (no path). See what happens next.
> >
> >         Hope this helps,
> >         Bart.
> 
> Hi Bart.
> Thanks for your tip.
> Unfortunately, this is exactly what I had tried (same dir and all) and the
> output was the error message:
> Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> Any other idea ?
> The script is at http://www.tug.org/applications/pdftex/epstopdf .

If you're getting this error, then your OS may not be finding
your copy of perl.  Check that your path contains the directory 
in which your perl.exe file sits.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 15:24:02 -0400
From: Andre Giroux <giroux@dms.umontreal.ca>
Subject: Re: Occasional user
Message-Id: <37406CD2.77BE7287@dms.umontreal.ca>

David Cassell a icrit :

> Andre Giroux wrote:
> >
> > Bart Lateur a icrit :
> >
> > > Andre Giroux wrote:
> > >
> > > >I am trying to convert a eps file into a pdf  file using a perl script
> > > >(file created by Mathematica and to be included  in a pdf document).
> > >
> > > I guess that's the EPS file, not the Perl script. The script probably
> > > serves to do some processing on the file?
> > >
> > > >Working on wintel, I downloaded perl and put my script in
> > > >c:\perl\bin .
> > >
> > > Bad place. Only stuff belonging to Perl itself should go there.
> > >
> > > >The question is : what should I do next ? (Or is it : what should I have
> > > >done before ? )
> > > >A lost mathematician.
> > >
> > > I guess you need to invoke the script with a command line like:
> > >
> > >         perl script.pl thatfile.eps
> > >
> > > where script.pl is the path to the script, and thatfile.eps is the path
> > > to the epsfile.
> > >
> > > My guess is that it's best to put the script next to the eps file, go to
> > > the DOS prompt, chdir to that directory, and run the script with the
> > > bare file names (no path). See what happens next.
> > >
> > >         Hope this helps,
> > >         Bart.
> >
> > Hi Bart.
> > Thanks for your tip.
> > Unfortunately, this is exactly what I had tried (same dir and all) and the
> > output was the error message:
> > Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> > Any other idea ?
> > The script is at http://www.tug.org/applications/pdftex/epstopdf .
>
> If you're getting this error, then your OS may not be finding
> your copy of perl.  Check that your path contains the directory
> in which your perl.exe file sits.
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

Hello David.
The installation of perl added the following line to the  autoexec.bat file :
  path "%path%;C:\Perl\bin;"
I guess this would be adequate. Or is it ?
Thanks for your time.


--
Andre Giroux
http://euler.dms.umontreal.ca/~giroux/




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

Date: Mon, 17 May 1999 15:25:32 -0400
From: Andre Giroux <giroux@dms.umontreal.ca>
Subject: Re: Occasional user
Message-Id: <37406D2C.691BCEE3@dms.umontreal.ca>

David Cassell a icrit :

> Andre Giroux wrote:
> >
> > Bart Lateur a icrit :
> >
> > > Andre Giroux wrote:
> > >
> > > >I am trying to convert a eps file into a pdf  file using a perl script
> > > >(file created by Mathematica and to be included  in a pdf document).
> > >
> > > I guess that's the EPS file, not the Perl script. The script probably
> > > serves to do some processing on the file?
> > >
> > > >Working on wintel, I downloaded perl and put my script in
> > > >c:\perl\bin .
> > >
> > > Bad place. Only stuff belonging to Perl itself should go there.
> > >
> > > >The question is : what should I do next ? (Or is it : what should I have
> > > >done before ? )
> > > >A lost mathematician.
> > >
> > > I guess you need to invoke the script with a command line like:
> > >
> > >         perl script.pl thatfile.eps
> > >
> > > where script.pl is the path to the script, and thatfile.eps is the path
> > > to the epsfile.
> > >
> > > My guess is that it's best to put the script next to the eps file, go to
> > > the DOS prompt, chdir to that directory, and run the script with the
> > > bare file names (no path). See what happens next.
> > >
> > >         Hope this helps,
> > >         Bart.
> >
> > Hi Bart.
> > Thanks for your tip.
> > Unfortunately, this is exactly what I had tried (same dir and all) and the
> > output was the error message:
> > Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> > Any other idea ?
> > The script is at http://www.tug.org/applications/pdftex/epstopdf .
>
> If you're getting this error, then your OS may not be finding
> your copy of perl.  Check that your path contains the directory
> in which your perl.exe file sits.
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

Hello David.
The installation of perl added the following line to the  autoexec.bat file :
  path "%path%;C:\Perl\bin;"
I guess this would be adequate. Or is it ?
Thanks.
--
Andre Giroux
http://euler.dms.umontreal.ca/~giroux/




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

Date: Mon, 17 May 1999 15:27:29 -0400
From: Andre Giroux <giroux@dms.umontreal.ca>
Subject: Re: Occasional user
Message-Id: <37406DA0.38C1A67A@dms.umontreal.ca>

David Cassell a icrit :

> Andre Giroux wrote:
> >
> > Bart Lateur a icrit :
> >
> > > Andre Giroux wrote:
> > >
> > > >I am trying to convert a eps file into a pdf  file using a perl script
> > > >(file created by Mathematica and to be included  in a pdf document).
> > >
> > > I guess that's the EPS file, not the Perl script. The script probably
> > > serves to do some processing on the file?
> > >
> > > >Working on wintel, I downloaded perl and put my script in
> > > >c:\perl\bin .
> > >
> > > Bad place. Only stuff belonging to Perl itself should go there.
> > >
> > > >The question is : what should I do next ? (Or is it : what should I have
> > > >done before ? )
> > > >A lost mathematician.
> > >
> > > I guess you need to invoke the script with a command line like:
> > >
> > >         perl script.pl thatfile.eps
> > >
> > > where script.pl is the path to the script, and thatfile.eps is the path
> > > to the epsfile.
> > >
> > > My guess is that it's best to put the script next to the eps file, go to
> > > the DOS prompt, chdir to that directory, and run the script with the
> > > bare file names (no path). See what happens next.
> > >
> > >         Hope this helps,
> > >         Bart.
> >
> > Hi Bart.
> > Thanks for your tip.
> > Unfortunately, this is exactly what I had tried (same dir and all) and the
> > output was the error message:
> > Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> > Any other idea ?
> > The script is at http://www.tug.org/applications/pdftex/epstopdf .
>
> If you're getting this error, then your OS may not be finding
> your copy of perl.  Check that your path contains the directory
> in which your perl.exe file sits.
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

Hello David.
The installation of perl added the following line to the  autoexec.bat file :
  path "%path%;C:\Perl\bin;"
I guess this would be adequate. Or is it ?
Thanks.
--
Andre Giroux
http://euler.dms.umontreal.ca/~giroux/




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

Date: Mon, 17 May 1999 15:48:55 -0400
From: Andre Giroux <giroux@dms.umontreal.ca>
Subject: Re: Occasional user
Message-Id: <374072A7.A93F72EB@dms.umontreal.ca>

David Cassell a icrit :

> Andre Giroux wrote:
> >
> > Bart Lateur a icrit :
> >
> > > Andre Giroux wrote:
> > >
> > > >I am trying to convert a eps file into a pdf  file using a perl script
> > > >(file created by Mathematica and to be included  in a pdf document).
> > >
> > > I guess that's the EPS file, not the Perl script. The script probably
> > > serves to do some processing on the file?
> > >
> > > >Working on wintel, I downloaded perl and put my script in
> > > >c:\perl\bin .
> > >
> > > Bad place. Only stuff belonging to Perl itself should go there.
> > >
> > > >The question is : what should I do next ? (Or is it : what should I have
> > > >done before ? )
> > > >A lost mathematician.
> > >
> > > I guess you need to invoke the script with a command line like:
> > >
> > >         perl script.pl thatfile.eps
> > >
> > > where script.pl is the path to the script, and thatfile.eps is the path
> > > to the epsfile.
> > >
> > > My guess is that it's best to put the script next to the eps file, go to
> > > the DOS prompt, chdir to that directory, and run the script with the
> > > bare file names (no path). See what happens next.
> > >
> > >         Hope this helps,
> > >         Bart.
> >
> > Hi Bart.
> > Thanks for your tip.
> > Unfortunately, this is exactly what I had tried (same dir and all) and the
> > output was the error message:
> > Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> > Any other idea ?
> > The script is at http://www.tug.org/applications/pdftex/epstopdf .
>
> If you're getting this error, then your OS may not be finding
> your copy of perl.  Check that your path contains the directory
> in which your perl.exe file sits.
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

Hello David.
The installation of perl added the following line to the  autoexec.bat file :
  path "%path%;C:\Perl\bin;"
I guess this would be adequate. Or is it ?
Thanks.
--
Andre Giroux
http://euler.dms.umontreal.ca/~giroux/




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

Date: Mon, 17 May 1999 15:56:00 -0400
From: Andre Giroux <giroux@dms.umontreal.ca>
Subject: Re: Occasional user
Message-Id: <37407450.7EAE2EEE@dms.umontreal.ca>

David Cassell a icrit :

> Andre Giroux wrote:
> >
> > Bart Lateur a icrit :
> >
> > > Andre Giroux wrote:
> > >
> > > >I am trying to convert a eps file into a pdf  file using a perl script
> > > >(file created by Mathematica and to be included  in a pdf document).
> > >
> > > I guess that's the EPS file, not the Perl script. The script probably
> > > serves to do some processing on the file?
> > >
> > > >Working on wintel, I downloaded perl and put my script in
> > > >c:\perl\bin .
> > >
> > > Bad place. Only stuff belonging to Perl itself should go there.
> > >
> > > >The question is : what should I do next ? (Or is it : what should I have
> > > >done before ? )
> > > >A lost mathematician.
> > >
> > > I guess you need to invoke the script with a command line like:
> > >
> > >         perl script.pl thatfile.eps
> > >
> > > where script.pl is the path to the script, and thatfile.eps is the path
> > > to the epsfile.
> > >
> > > My guess is that it's best to put the script next to the eps file, go to
> > > the DOS prompt, chdir to that directory, and run the script with the
> > > bare file names (no path). See what happens next.
> > >
> > >         Hope this helps,
> > >         Bart.
> >
> > Hi Bart.
> > Thanks for your tip.
> > Unfortunately, this is exactly what I had tried (same dir and all) and the
> > output was the error message:
> > Wrong command or filename ( in french Commande ou nom de fichier incorrect).
> > Any other idea ?
> > The script is at http://www.tug.org/applications/pdftex/epstopdf .
>
> If you're getting this error, then your OS may not be finding
> your copy of perl.  Check that your path contains the directory
> in which your perl.exe file sits.
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

Hello David.
The installation of perl added the following line to the  autoexec.bat file :
  path "%path%;C:\Perl\bin;"
I guess this would be adequate. Or is it ?
Thanks.
--
Andre Giroux
http://euler.dms.umontreal.ca/~giroux/




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

Date: Mon, 17 May 1999 13:45:31 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: OOP and Perl-a good book?
Message-Id: <x3yiu9rtwsk.fsf@tigre.matrox.com>


"%GIVEN NAME% o'regan" <"%GIVEN NAME%.o'regan"@port.ac.uk> writes:

> Would any be able recommend a good book that addresses OO in Perl
> comprehensively?

Firstly, I would recommend the standard documentation that comes with
Perl itself. Have a look at the following:

	perlref
	perltoot
	perlobj
	perlmod
	perlmodlib
	perlbot

If you still need more info, I would suggest you get a copy of 

	the Panther (Advanced Perl Programming, by Srinivasan,
	             Published by O'Reilly)
	the Ram     (Perl CookBook, by Christiansen and Torkington,
	             Published by O'Reilly)

HTH,
Ala



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

Date: Mon, 17 May 1999 14:10:26 -0500
From: "Mark Lewis" <mlewis@worldnetcorp.com>
Subject: Perl / Sybase Opening
Message-Id: <926968716.006.40@news.remarQ.com>

Dear Consultant,
                            My client (Financial Instituation) is seeking 2
Perl / Sybase consultants for a 6+ month assignment in Downtown Chicago.

The client needs the consultants to be strong in Perl Scripting in order to
put together end of day jobs for the client.

Please send all qualified resumes, including rate to:

mlewis@worldnetcorp.com

Thanks and have a great  day.

Mark

=========================
Mark Lewis
Worldnet Corporation
888-226-6758x18
mlewis@worldnetcorp.com
=========================




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

Date: Mon, 17 May 1999 19:48:33 GMT
From: elvis@NOTGRACELANDclark.net
Subject: Reading in a file and outputting to browser
Message-Id: <lo_%2.953$Ku4.33382@iad-read.news.verio.net>

If I would have pictures in the cgi-bin dir, if I read one in, how do I output it to the browser so that it doesn't show up as "garbage and gobly gook."  Example, if I open a filehandle and print $_, after doing a print header, it shows up as the binary code, instead of the browswer decoding the jpeg image.  I do a print header; print "Content-Type: image/jpeg" ; and it still doesn't work, I tried just the print "Content-Type etc" and I got a malformed header error.

Any ideas?

-- 
Bill
elvis@NOTGRACELAND.clark.net


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

Date: Mon, 17 May 1999 19:57:20 GMT
From: elvis@NOTGRACELANDclark.net
Subject: Re: Reading in a file and outputting to browser
Message-Id: <Aw_%2.955$Ku4.33503@iad-read.news.verio.net>

elvis@NOTGRACELANDclark.net wrote:
: If I would have pictures in the cgi-bin dir, if I read one in, how do I output it to the browser so that it doesn't show up as "garbage and gobly gook."  Example, if I open a filehandle and print $_, after doing a print header, it shows up as the binary code, instead of the browswer decoding the jpeg image.  I do a print header; print "Content-Type: image/jpeg" ; and it still doesn't work, I tried just the print "Content-Type etc" and I got a malformed header error.

: Any ideas?

: -- 
: Bill
: elvis@NOTGRACELAND.clark.net

Literally 1 min after I sent this, I figured it out

use LWP::MediaTypes qw(guess_media_type);

$mediatype = guess_media_type("$path/to/picture/picture.ext") ;

print "Content-type: $mediatype", "\n\n" ;

viola...worked fine.

Are there any security issues using this method?..readnig a file in from the cgi-bin dir (I also posted this to the comp.sys.somethingorother.cgi authoring newsgroup)

-- 
Bill
elvis@NOTGRACELAND.clark.net


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

Date: Mon, 17 May 1999 13:54:05 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Reg Exp Q!
Message-Id: <3740579d.0@usenet.fccj.cc.fl.us>

I started to give up and ask what this matches -

/(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i;

but I am not; I will post what I think the answer is shortly...

Embarrassing, huh?,
-Sneex-  :]
______________________________________________________________________
Windows is a 32-bit extension for a 16-bit patch for a 8-bit operating
system which was originally coded for a 4-Bit microprocessor by a
2-bit company that can't stand 1-bit of competition. :)

         Jacksonville Perl Mongers
         http://jacksonville.pm.org
         jax@jacksonville.pm.org


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 5703
**************************************

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