[13306] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 716 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 4 16:07:23 1999

Date: Sat, 4 Sep 1999 13:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 4 Sep 1999     Volume: 9 Number: 716

Today's topics:
    Re: CGI in PERL <flavell@mail.cern.ch>
        Code Review Please (Ronald E Jeffries)
    Re: Code Review Please <uri@sysarch.com>
    Re: Code Review Please (Randal L. Schwartz)
    Re: Code Review Please (Abigail)
    Re: Code Review Please (Abigail)
        collaboration anyone? <dthusma@home.com>
    Re: darndest regex thing <rick.delaney@home.com>
    Re: darndest regex thing <rick.delaney@home.com>
    Re: Dos Perl and System command (Nim Chu)
    Re: email address verification <bigsleep@dircon.co.uk>
    Re: Filter (Bill Moseley)
    Re: Form2Mail without user interaction? <flavell@mail.cern.ch>
        Format a var to 2 decimal places!! <rich.harris@#prodigy.net>
        generating a sequential alpha-numeric string (Michael Gold)
    Re: generating a sequential alpha-numeric string (Randal L. Schwartz)
        How to post to a NNTP-server with perl? sawadee176@my-deja.com
        IO::Select <royman@bart.nl>
        non root module install on FreeBSD-3.2 <DrXyzzy@mediaone.net>
        Perl for Windows98 Apache <tokaev@triniti.troitsk.ru>
    Re: Perl for Windows98 Apache llornkcor@my-deja.com
        perl script Q: convert eps -> gif (ahq)
        Perl vs. Python as 1st language? <jbc@shell2.la.best.com>
    Re: Perl's underlying implementation of Arrays - Low Pr (Gabor)
        Perl-Server-Applikation wird bei exec() beendet <klehmann-news@gmx.net>
    Re: Perl-Server-Applikation wird bei exec() beendet <klehmann-news@gmx.net>
        PERL4 vs PERL5 <nmurphy708@earthlink.net>
    Re: PERL4 vs PERL5 (Randal L. Schwartz)
        Unsure how to use suidperl correctly. <john@hendigital.com.au>
        Wow! Praises from a Newbie robert_kolker@hotmail.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 4 Sep 1999 15:06:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI in PERL
Message-Id: <Pine.HPP.3.95a.990904150514.13815E-100000@hpplus03.cern.ch>

On Sat, 4 Sep 1999 pjgratz@my-deja.com wrote:

> Just make sure you know what your talking about
> before you slam someone. 

Good advice.  You don't seem willing to take it though.

> Besides were a community to help.

Past tense???



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

Date: Sat, 04 Sep 1999 13:33:50 GMT
From: ronERASEjeffries@ERASEacm.org (Ronald E Jeffries)
Subject: Code Review Please
Message-Id: <37d11f8c.51448768@news.det.ameritech.net>

This subroutine answers the Title from the HTML page in its input
filename. How would you improve or rewrite, please?

Thanks!

sub title  {
    my ($filename) = @_;
    my ($title);
    open(FILE, $filename) or die "Can't open `$filename': $!";
    while (<FILE>) {
    	if ( m|<title>(.*)</title>|i) {
    		$title = $1;
    		last;
    	}
    }
  	close FILE;
  	$title;
}


Ron Jeffries
http://www.XProgramming.com
Disclaimer:  I could be wrong -- but I'm not.
	(Eagles, "Victim of Love")


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

Date: 04 Sep 1999 12:25:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Code Review Please
Message-Id: <x7k8q6skxp.fsf@home.sysarch.com>

>>>>> "REJ" == Ronald E Jeffries <ronERASEjeffries@ERASEacm.org> writes:

  REJ> This subroutine answers the Title from the HTML page in its input
  REJ> filename. How would you improve or rewrite, please?

  REJ> sub title  {
  REJ>     my ($filename) = @_;
  REJ>     my ($title);

you don't localize the file handle. you could clobber some open FILE.

	local( *FILE) 
  REJ>     open(FILE, $filename) or die "Can't open `$filename': $!";

good, you check the result of open.

  REJ>     while (<FILE>) {

what if the title were on more than one line? this would not find it.

slurp the whole file in with:

		{ local $/; $_ = <FILE> }

and no need for a loop.

  REJ>     	if ( m|<title>(.*)</title>|i) {

if someone had wacky html or the string </title> latr in the file you
would match all the intervening text. use a non-greedy modifier. i also
tacked on the /s modifier so the .* can match newlines.

		if ( m|<title>(.*?)</title>|is) {

but even that is not guaranteed to work as this can be faked out by
comments and other stuff. regex grabbing of html is not clean in
general. if you know the format of the files are guaranteed (you wrote
or created them or they have a fixed format) then this should work.

  REJ>     		$title = $1;
  REJ>     		last;
you could have just done return( $1 ).

  REJ>     	}
  REJ>     }
  REJ>   	close FILE;
  REJ>   	$title;
  REJ> }

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 04 Sep 1999 09:25:39 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Code Review Please
Message-Id: <m1aer2k5j0.fsf@halfdome.holdit.com>

>>>>> "Ronald" == Ronald E Jeffries <ronERASEjeffries@ERASEacm.org> writes:

Ronald> This subroutine answers the Title from the HTML page in its input
Ronald> filename. How would you improve or rewrite, please?

Ronald> Thanks!

Ronald> sub title  {
Ronald>     my ($filename) = @_;
Ronald>     my ($title);
Ronald>     open(FILE, $filename) or die "Can't open `$filename': $!";
Ronald>     while (<FILE>) {
Ronald>     	if ( m|<title>(.*)</title>|i) {
Ronald>     		$title = $1;
Ronald>     		last;
Ronald>     	}
Ronald>     }
Ronald>   	close FILE;
Ronald>   	$title;
Ronald> }

I'd use standard modules:

  sub title {
    use HTML::HeadParser;
    my $text = do { local ($/,*ARGV); @ARGV = @_; <> };
    my $p = HTML::HeadParser->new;
    $p->parse($text);
    $p->header("Title");
  }

Yours fails if <title> and </title> are on separate lines, doesn't
take into consideration any entity escapes (<title>Fred &amp;
Barney</title>), and finds titles in the body of the text, and doesn't
properly ignore comments (<!-- <title>old title</title> -->
<title>real title</title>).

Don't reinvent the wheel, unless your wheel rolls everywhere the
original wheel also rolls.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 4 Sep 1999 14:05:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Code Review Please
Message-Id: <slrn7t2rge.dsn.abigail@alexandra.delanet.com>

Ronald E Jeffries (ronERASEjeffries@ERASEacm.org) wrote on MMCXCV
September MCMXCIII in <URL:news:37d11f8c.51448768@news.det.ameritech.net>:
-- This subroutine answers the Title from the HTML page in its input
-- filename. How would you improve or rewrite, please?

Yet another person who doesn't listen and thinks one can parse
HTML using simple regexes.

     YOU CANNOT PARSE HTML WITH SIMPLE REGEXES.

Consider for instance:

     <title>
     Foo
     </title>

or:

     <title>Foo</title><!--<title>Bar</title>-->



You might consider reading the FAQ.



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 4 Sep 1999 14:26:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Code Review Please
Message-Id: <slrn7t2sp9.dsn.abigail@alexandra.delanet.com>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMCXCV September
MCMXCIII in <URL:news:m1aer2k5j0.fsf@halfdome.holdit.com>:
() 
() I'd use standard modules:

HTML::HeadParser isn't part of the standard distribution, so I 
would not call that "standard".

()   sub title {
()     use HTML::HeadParser;
()     my $text = do { local ($/,*ARGV); @ARGV = @_; <> };
()     my $p = HTML::HeadParser->new;
()     $p->parse($text);
()     $p->header("Title");
()   }
() 
() Yours fails if <title> and </title> are on separate lines, doesn't
() take into consideration any entity escapes (<title>Fred &amp;
() Barney</title>), and finds titles in the body of the text, and doesn't
() properly ignore comments (<!-- <title>old title</title> -->
() <title>real title</title>).
() 
() Don't reinvent the wheel, unless your wheel rolls everywhere the
() original wheel also rolls.


Well, yeah, good advice, but I wouldn't use modules that don't work:

   #!/opt/perl/bin/perl -w

   use strict;
   use HTML::HeadParser;


   my $text = <<'EOT';
   <script>
   // document.write ("<title>Bar<\/title>");
   // document.write ("<!--")
   </script>
   <title>Foo</title>
   <script>
   // document.write ("<title>Bar<\/title>");
   // document.write ("-->")
   </script>
   <h1>Quz</h1>
   EOT


   my $p = HTML::HeadParser -> new;

   $p -> parse ($text);

   my $t = $p -> header ('Title');

   print $t, "\n";
   __END__
   Bar<\/title>"); //document.write ("")


Not to mention that HTML::HeadParser doesn't realize that multiple
LINK elements are allowed.


Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 04 Sep 1999 16:35:39 GMT
From: Darrin H <dthusma@home.com>
Subject: collaboration anyone?
Message-Id: <37D14DB7.BCD065C8@home.com>

I am currently working on beta-revision code of an enterprise-scale perl
application
and starting beta code on another.

I am looking for fellow pgrms to work with on
revisions-compilation-cross platform issues,
publications, documentation and modulization.



Any takers?



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

Date: Sat, 04 Sep 1999 14:36:54 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: darndest regex thing
Message-Id: <37D12E74.C69EBFCA@home.com>

[posted & mailed]

lt lindley wrote:
> 
> elephant <elephant@squirrelgroup.com> wrote:
> :>>
> :>>$_ = qq!first second "the third token" fourth!;
> :>>@a = m/(?:\"(.+?)\")|(\S+)/g;
> 
> :>each time this matches it fills up TWO backreferences .. ie. the first
> :>time it sees \"(.+?)\" OR (\S+) it fills up $1 and $2 .. the second time
> :>it fills up $3 and $4 .. the third $5 and $6 and the fourth $7 and $8
> 
> Can you demonstrate that?  In a loop it would be only $1 and $2 (one
> of which is undef) each time through the loop.  In this list context I
> can't see $1 or $2 being set at all, much less $5 or $6.

/g is a loop in list context.  So $1 and $2 are set for each match. 
After the m// expression they will contain the values for the last
match--in this case ($1, $2) = (undef, 'fourth').

$3, etc. are never set in this example.  Think what that would do to you
in s///!

    s/(?:\"(.+?)\")|(\S+)/ucfirst (defined $1 ? $1 : $2)/ge;

would have to become

    {
        no strict 'refs';
        my $i = 1;
        s/(?:\"(.+?)\")|(\w+)|(\S+)/
            my $x = ucfirst (defined ${$i} ? ${$i} : ${$i + 1});
            $i += 2;
            $x
        /ge;
    }

Ugh!

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sat, 04 Sep 1999 14:46:33 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: darndest regex thing
Message-Id: <37D130B9.8EB3DE96@home.com>

[posted & mailed]

elephant wrote:
> 
> Rick Delaney writes ..
> >[posted & mailed]
> 
> you're too nice

Not really.  It is easy enough to cc someone, so why not?

I guess I'm too naive, though.  I just blindly assume that someone who
asks for a cc will have a valid email address.

Since Mr. Mayer is afraid of Usenet and afraid of spammers I'm afraid he
won't see my reply.

> >    push @a, $+ while m/(?:\"(.+?)\")|(\S+)/g;
> 
> thanks for posting this Rick .. I'd never noticed that little $+

You're welcome.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sat, 04 Sep 1999 19:19:21 GMT
From: nimchu@hal-pc.org (Nim Chu)
Subject: Re: Dos Perl and System command
Message-Id: <7qrgre$1a27$1@news.hal-pc.org>

"George M. Pieri" <george.pieri@mci.com> wrote:

>Has anyone successfully used the system command or back ticks
>to execute a command from a DOS perl script ?
>system "dir " ; or=20
>`dir`
>produces no results.

If you store the result in a variable, then you can see it. E.g.

$r=`dir`;
print $r;



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

Date: Sat, 4 Sep 1999 14:16:02 +0100
From: "Andrew Whitaker" <bigsleep@dircon.co.uk>
Subject: Re: email address verification
Message-Id: <37d11bbd_1@newsread3.dircon.co.uk>

After you have filtered the syntax of the email address, I use this bit of
code to check the domain :-

sub CheckDomain {
    my( $Domain ) = @_;
    my( @Dig );

    return 0 if ! open( DIGPROG, "dig MX $Domain |" );
    @Dig = <DIGPROG>;
    close( DIGPROG );
    @Dig = grep( /^$Domain.*\sMX\s/ , @Dig );
    return @Dig > 0;
}

The command line dig program is a bit intensive but suitable for form to
email type things.

Andy Whitaker
Cimexmedia Ltd

Paul Falardeau wrote in message <37C18541.6060235@tp.net>...
>Hello,
>
>I know I've seen this posted to this list before, but I just can't find
>it.
>
>Can somebody please post a snippet of code which will check the validity
>
>of an email address?  For example I want to return an error if someone
>enters something like jsmith@aol rather than jsmith@aol.com
>
>Thanks,
>
>Paul...
>




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

Date: Sat, 4 Sep 1999 06:38:03 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Filter
Message-Id: <MPG.123ac09650516f89989702@nntp1.ba.best.com>

Jimtaylor5 (jimtaylor5@aol.com) seems to say...
> I am writing a childrens program and I need to filter out at least some
> offensive words. Of course I know how to match with =~/***/ but the problem I
> am having is this also filters out words like pass and assimilate. Is there a
> way I can do this that it won't catch these words, and words like it for other
> offensive words? Thanks!

Well, we would have to see the Complete List of Offensive Words to 
really offer any advice...  But in your example above you need to use 
something in the regular expression to say you are on a word boundary.

perldoc perlre

I assume, no pun intended, that '***' above is 'ass', and not really 
'***'.  If it is really '***' then you need to do a bit more homework.  
Or course, if it is really 'ass' then you the expressing you are looking 
for is s/^.*$//;

Typically, as with, say, CGI security, it is much better to define what 
is allowable, instead of what isn't allowable.  So you will be better 
off in the long run just define what words are ok.

Good luck,


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Sat, 4 Sep 1999 14:59:59 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Form2Mail without user interaction?
Message-Id: <Pine.HPP.3.95a.990904145639.13815D-100000@hpplus03.cern.ch>

On Sat, 4 Sep 1999, TomTech wrote:

> Sorry I'm in the wrong group....

You are.

> Figured that if one is knowledgable about Perl, then they would first
> have a very solid understanding of HTML and page design in general.

Some do, and exhibit it in the appropriate place.  Some have other
issues to worry about.  Steel fabrications, in the case of one of my
usenet contacts.  So would he ask here about steel fabrications?  It
makes about as much sense.

> Guess I was wrong.

Yes, you were wrong, but you're telling us you still don't know why.

> Later

Let's hope not.

-- 

    Note : there are only about CCL years (written in MCMXCVII) until 
    the Annus MMM AUC, which is itself no great problem; but in the 
    year MMDCCCLXXXVIII the date field will be longer than ever before.
          - John Stockton, http://www.merlyn.demon.co.uk/miscdate.htm




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

Date: Sat, 4 Sep 1999 14:23:49 -0400
From: "Rich Harris" <rich.harris@#prodigy.net>
Subject: Format a var to 2 decimal places!!
Message-Id: <7qro89$7a4m$1@newssvr04-int.news.prodigy.com>

I'm sorry this has got to be a simple one, but I can't do it.

How do you format a variable to 1 or 2 decimal places?

Also are there any good sites out there which list perl commands etc.

Thanks
Rich




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

Date: Sat, 04 Sep 1999 15:40:29 GMT
From: mgold@bway.net (Michael Gold)
Subject: generating a sequential alpha-numeric string
Message-Id: <N3bA3.11373$kO6.26072757@news.optonline.net>


Hi All

I am looking to generate an eight digit  alpha-numeric string ie. w1234567 for 
a web application.  It will be a confirmation number that appears on a web 
page and needs to be emailed in the confirmation to the end user.

I have seen random number generators but how do I do an alpha character and a 
sequential number?  As well I have used email confirmations with cgi forms 
before, how do I include the confirmation number in the email?

Any help is appreciated.

Thanks.


Michael Gold
mgold@bway.net


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

Date: 04 Sep 1999 09:29:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: generating a sequential alpha-numeric string
Message-Id: <m1671qk5bs.fsf@halfdome.holdit.com>

>>>>> "Michael" == Michael Gold <mgold@bway.net> writes:

Michael> I am looking to generate an eight digit alpha-numeric string
Michael> ie. w1234567 for a web application.  It will be a
Michael> confirmation number that appears on a web page and needs to
Michael> be emailed in the confirmation to the end user.

Michael> I have seen random number generators but how do I do an alpha
Michael> character and a sequential number?

You need to maintain state, usually with a file of some kind (or you
could use a database).  The File::CounterFile module is probably
right what you are looking for.

	use File::CounterFile;
	my $c = File::CounterFile->new("/some/path/to/COUNTER", "w0000000");
	$c->lock;
	my $id = ++$c;
	$c->unlock;
	## send $id in mail

I believe this is part of LWP.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 04 Sep 1999 14:45:59 GMT
From: sawadee176@my-deja.com
Subject: How to post to a NNTP-server with perl?
Message-Id: <7qrbb4$a7g$1@nnrp1.deja.com>

I try to find a syntax to post messages, entered
on my website (guestbook) via perl-script to (my
own) news-server (nntp on IIS4).

Thanks for help.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sat, 04 Sep 1999 17:22:39 +0200
From: The RoYMaN <royman@bart.nl>
Subject: IO::Select
Message-Id: <37D1393E.659DADEE@bart.nl>

Hello

I'm working on a chat server in the unix domain (IO::Socket::unix).
when i use 1 client and the server to talk it works with no problems,
however when i try to let it accept multiple clients and echo to all
using IO::Select.
When i trie to run it it says: "Can't locate auto/IO/Select.al in @INC
followed by the install dirs...
I'm using perl 5.00405, the directory's it shows when it says
@INC contains: are the ones i installed perl in, i searched all through
my system for this file. but i can't find it
I assume this file is part of the IO::Select module which comes with
perl, so either it should be on my system, or it's generated
automatically...

So basicly i'd like to know what this file is, where it comes from, why
i don't have it and, if i have to download it somewhere, where i can get
it.

Thanks

Roger



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

Date: 04 Sep 1999 12:55:13 -0500
From: hws <DrXyzzy@mediaone.net>
Subject: non root module install on FreeBSD-3.2
Message-Id: <86k8q636ke.fsf@gamera.hws>

Saturday's recipe of the day on www.perl.com
  http://www.perl.com/pub/universal/pcb/solution.html
states that a Perl module may be installed to a locally owned
directory, and thus may be installed without the need for superuser
privileges, by, e.g.

  perl Makefile.PL LIB=~/lib

or

  perl Makefile.PL PREFIX=~/perl5-private

Any ideas why this would fail on FreeBSD-3.2? I tried using the
bundled perl 5.005_03, attempting to install Storable.pm (version
Storable-0.6@4).

The non-root install succeeds, BTW, on a recent OpenBSD-2.5 snapshot
which reports the same version of Perl.

In each case, attempting the final "make install" step as non-root
fails:

with LIB=~/lib:

mkdir /usr/local/lib/perl5/5.00503:
Permission denied at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 57
*** Error code 2



with PREFIX=~/perl5-private:

mkdir /usr/local/lib/perl5/site_perl:
Permission denied at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 57
*** Error code 2


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

Date: Sat, 04 Sep 1999 20:02:47 +0400
From: tokaev <tokaev@triniti.troitsk.ru>
Subject: Perl for Windows98 Apache
Message-Id: <37D142A7.31649788@triniti.troitsk.ru>

How I can set and use Perlo for Apache on Windows 95/98 platforms?
tokaev@hotmail.com



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

Date: Sat, 04 Sep 1999 17:05:57 GMT
From: llornkcor@my-deja.com
Subject: Re: Perl for Windows98 Apache
Message-Id: <7qrjhh$flg$1@nnrp1.deja.com>

http://www.activestate/activeperl

In article <37D142A7.31649788@triniti.troitsk.ru>,
  tokaev <tokaev@triniti.troitsk.ru> wrote:
> How I can set and use Perlo for Apache on Windows 95/98 platforms?
> tokaev@hotmail.com
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 4 Sep 1999 09:08:38 GMT
From: ahq@bigfoot.com (ahq)
Subject: perl script Q: convert eps -> gif
Message-Id: <8E375F372ahqbigfootcom@nntp.smartdna.com>

Hi, All:

i like to generate eps then transfer to gif.
(use gnuplot 3.7, ImageMagick's convert)
is there a perl script which can utilize unix pipe function
and won't generate intermedia file?

this is the script i have now:


----------------------------------------------------------
        $out_eps = "/SPC/html/output/test_5.eps";
        $out_gif  = "/SPC/html/output/test_5.gif";

        my $GNUPLOT = '/home/gnuplot/bin/gnuplot';

        $|=1;
        open (GRAPH,"| $GNUPLOT  > $out_png_") || print " not $out_eps \n" ;

 --->   system(" /home/gnuplot/bin/convert -density 144 $out_eps $out_gif");

 
        my $buf ="";
        $buf .= "set term postscript eps color dashed 'Times-Romans' 18 \n";
        $buf .= "set linestyle 1 lt 12 lw 5 pt 7 ps 2\n";       #data1
        ......
    	  ......
    	  $buf .= "plot.......";

        print GRAPH "$buf \n";
        close GRAPH;
------------------------------------------------------------

Is the a way i can put the "convert" (from ImageMagick) into the
pipe? 
( the usage for convert: convert xx.eps xx.gif)

Thanks.


Q
ps: aditional email to me would be appriciated. :)


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

Date: 04 Sep 1999 19:32:05 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Perl vs. Python as 1st language?
Message-Id: <37d173b5$0$207@nntp1.ba.best.com>

Apologies in advance for the done-to-death topic. I'm curious what some
of the experts hereabouts would say in response to the arguments in
Guido's proposal for the "Computer Programming for Everybody" project,
at:

http://www.python.org/doc/essays/cp4e.html 

He appears to be seeking (or may already have obtained; I'm not quite
clear on the proposal's exact status) DARPA funding to help develop and
promote a Python-centered programming curriculum for US high schools
and colleges. In the section titled "Why Start with Python?" he writes:

[quote begins]

Python is a good language for teaching absolute beginners. It derives
many of its critical features from ABC, a language that was designed
specifically for teaching programming to non-experts [ABC] [Geurts].
The Python community has seen many reports from individuals who taught
their children programming using Python. The consensus from these
reports is that the language itself is well suited for this
purpose--unlike, for example, C++, Java, Perl, Tcl, or Visual Basic,
which are too cluttered with idiosyncrasies.

[quote ends]

Anyway, I'd be interested in what those who are experienced with both
Perl and Python (which I'm not) might have to say about this. Thanks.

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: 4 Sep 1999 15:58:58 -0400
From: gabor@vmunix.com (Gabor)
Subject: Re: Perl's underlying implementation of Arrays - Low Priority
Message-Id: <slrn7t2ug2.bbe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Nick Read <nickread@primus.com.au> wrote :
# Hey all,
# 
# This is to all those people out there who have fiddled with Perl's innards
# and know how it's data structures are implemented.
# 
# Now I assume that since Perl's arrays are dynamic (grow/shrink) they are
# probably implemented as some form of linked-list in the underlying C code.

Why?  Linked lists are horrible data structures for the most part.
It's easy to implement growing and shrinking arrays.


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

Date: Sat, 04 Sep 1999 21:12:21 +0200
From: Karsten Lehmann <klehmann-news@gmx.net>
Subject: Perl-Server-Applikation wird bei exec() beendet
Message-Id: <37D16F14.7183C366@gmx.net>

Sch=F6nen Tag.

Ich schreibe momentan an einem Abrechnungssystem f=FCr ein WG-Netzwerk.
Auf dem Server l=E4uft ein Perl-Script im Endlos-Modus (while(1)-Schleife=
,
zwischendurch mit "sleep(1)" IDLE gemacht, um den Cyrix-Prozessor nicht
mit 99% Aktivit=E4t zu killen).
Wird ein CGI-Script auf dem Apache-Server von einem der Client-Rechner
ausgef=FChrt, dann schreibt es die Sequenz
"Online,Karsten,Nikoma" in die Datei /connect-logs/queue.file.
Diese wird durch die Endlosschleife =FCberwacht und bei vorhandenen
Befehlen abgearbeitet.

In dem oben beschriebenen Fall mu=DF also das Perlscript die Einwahl
vornehmen, implementiert durch

exec("/connect-logs/provider/Nikoma/ppp-up");

Mir ist nun aufgefallen, da=DF sich meine Endlos-Applikation nach diesem
Befehl verabschiedet, ich durch sie also nicht mehr offline gehen kann
("Offline,Karsten").

Der exec-Befehl soll doch eigentlich einen unabh=E4ngig laufenden Proze=DF=

starten.
Wieso wird dann trotzdem mein Programm beendet und wie l=E4=DFt sich das
verhindern?

Karsten


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

Date: Sat, 04 Sep 1999 21:38:45 +0200
From: Karsten Lehmann <klehmann-news@gmx.net>
Subject: Re: Perl-Server-Applikation wird bei exec() beendet
Message-Id: <37D17544.4FBDD89D@gmx.net>

I=B4m sorry for writing this text in German. I just realized afterwards
that i forgot the "de." in front of "comp.lang.perl.misc".
So I have to try to tell my problem again, this time in English:

I am currently writing a perl script in order to calculate the amount of
money everybody has to pay for his online activities in a network.
On the server I run a script like
while (1)
{
#check the message queue file
#if there are any lines in there, go online/offline

#go into idle mode, a Cyrix doesn=B4t like 99 percent activity
sleep(1);
}

If I write "Online,Karsten,Nikoma" into /connect-logs/queue.file , the
server tries to execute pppd:

exec("/connect-logs/provider/Nikoma/ppp-up");

My problem is: after this command is executed, my script is beeing
stopped with "Exit 5" - I startet it with "./daemon &".
How can I avoid this?
I thought, "exec" would generate an independent process. How can it
force my script to end?

Karsten


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

Date: Sat, 04 Sep 1999 09:15:36 -0700
From: Natalie Murphy <nmurphy708@earthlink.net>
Subject: PERL4 vs PERL5
Message-Id: <37D1459C.A5A1EFE4@earthlink.net>

What's a good reference to understand the differences between PERL4 and
PERL5?  Can they run at the same time on the same machine?



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

Date: 04 Sep 1999 10:41:54 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: PERL4 vs PERL5
Message-Id: <m1u2painfh.fsf@halfdome.holdit.com>

>>>>> "Natalie" == Natalie Murphy <nmurphy708@earthlink.net> writes:

Natalie> What's a good reference to understand the differences between
Natalie> PERL4 and PERL5?

One of them is a language with a 2-million-plus-and-growing user
community, actively supported, commercial support available, invoked
thousands of times per second in applications worldwide, actively
being developed and expanded, with a huge online repository of useful
ready-to-use scripts, modules, and ports to nearly anything that has a
CPU, supporting programming in the large, object-oriented programming,
interface to C and other languages, with worldwide corporate and
open-enrollment trainings available.

The other is an ancient, dead, not-to-be-used, unsupported,
CERT-notified-security-bugridden ancient version of a language that
helped the web get its start, and sysadms get their job done faster,
but is now abandoned by anyone in the know.

I'll let you figure out which is which. :)

p.s.: bigger clue stick: don't use Perl4.  It's dead.  5 years dead.
The *only* Perl is Perl 5.  5.005_03 preferably.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 04 Sep 1999 21:53:01 +0800
From: John Hennessy <john@hendigital.com.au>
Subject: Unsure how to use suidperl correctly.
Message-Id: <37D1243D.9CD551F7@hendigital.com.au>

I understand the concept of suid but after reading through the perlfaqs
and the O'Reilly Perl books but am still unable to find specific
examples of how to make this work.

Do I have to "use POSIX qw(setuid)" or set the sticky bit on the perl
script itself ?

All I need if for my CGI script to execute a shell command as root.






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

Date: Sat, 04 Sep 1999 17:11:15 GMT
From: robert_kolker@hotmail.com
Subject: Wow! Praises from a Newbie
Message-Id: <7qrjrd$foo$1@nnrp1.deja.com>

After nibbling around the edges of PERL for several months I have
finally gotten down to doing some substantial programming in the
language.

Even though I am a rank Newbie, I have been able to write some
"quick and dirty" utilities in under 5 minutes that would have taken
an hour to write in a programn language such as C, C++ or Java.

Larry Wall, and all the programmers whose creativity he has help
unleash are True Geniuses.  It is such a damn shame that Wall and
his collegues  have made only a fraction of the money that the
Bogoid Billionaire Bill Gates has made producing pure dreck.

All praises to the real producers such as Wall and all the programmers
who have contributed useful modules that make my life very much
easier.

Bob Kolker


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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