[12759] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 169 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 16 17:07:18 1999

Date: Fri, 16 Jul 1999 14:05:12 -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           Fri, 16 Jul 1999     Volume: 9 Number: 169

Today's topics:
    Re: "cutting" part of a file <dan@fearsome.net>
    Re: bogus "used only once" message? (Bart Lateur)
        cgi compiler <babyh@forfree.at>
    Re: Como ler un directorio... <gellyfish@gellyfish.com>
    Re: date_command in NT paul_rahe@cissc.canon.com
    Re: die ? (Abigail)
    Re: Exclusive range operator ( ... ) <uri@sysarch.com>
    Re: Exclusive range operator ( ... ) <tchrist@mox.perl.com>
    Re: Exclusive range operator ( ... ) <tchrist@mox.perl.com>
    Re: Exclusive range operator ( ... ) <uri@sysarch.com>
        executing commands, command-line vs. browser mchesler@my-deja.com
    Re: FAQ 5.7: How can I use a filehandle indirectly? (Jeff Zeitlin)
        glob("*.*") gives "File not found message" on NT (Ronan Cremin)
    Re: I need to hide the source <jason@killdare.demon.co.uk>
    Re: Linux - Apache - Perl (I R A Aggie)
    Re: Linux - Apache - Perl (Abigail)
    Re: Linux - Apache - Perl <gellyfish@gellyfish.com>
    Re: long explanations wearying (was Re: Top 10 response (Abigail)
    Re: MYSQL - Help (Abigail)
        netout: Broken Pipe Error avong4360@my-deja.com
        Padding numbers with 0's (Jason Stapels)
    Re: Padding numbers with 0's (Larry Rosler)
    Re: PDF-TXT <camerond@mail.uca.edu>
    Re: Perl before Swine? <burton@lucent.com>
        perl ftp module <dthusma@home.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 16 Jul 1999 20:49:42 +0100
From: "Dan Adams" <dan@fearsome.net>
Subject: Re: "cutting" part of a file
Message-Id: <932157575.28787.0.nnrp-14.c2deb1c5@news.demon.co.uk>

(Posted to newsgroup and mailed to author)

Thanks for the link to ActivePerl. I actually had it briefly, but I had to
reformat and my machine is on dialup at the moment (in the UK - call
charges) so I can't really download it again.

I read your reply, but I can't really see that it helps. I think that the
WHILE part might be useful, but its what would go in inside that WHILE that
would matter.

maybe I didn't explain what I was trying to do. I have a text file that
looks like this:

"randomtextnonsense babble babble foobar babble foo <start> babble bar
babble babble etc"

What I need to do is essentially split the file in two - to make the
original file into a file of the same name containing only everything up to
<start> and then to make a seperate file out of everything including and
forward of the "<start>". Sorry if I didn't communicate this very well. I
just can't figure out how to do this. Is that same perldoc page still
relevant, or should I be looking at a different section?

Thanks for any help,

Dan Adams
dan@fearsome.net

Eric The Read <emschwar@rmi.net> wrote in message
news:xkfd7xsjvc3.fsf@valdemar.col.hp.com...
> "Dan Adams" <dan@fearsome.net> writes:
> > Can someone give me some handy pointers. I don't have Perl, and
> > therefore no manpages, on my local system,
>
> Since you appear to be on a PoB system, from your headers:
>
> X-Newsreader: Microsoft Outlook Express 5.00.2615.200
>
> You can go to <URL:http://www.activestate.com/ActivePerl/> and get Perl.
>
> > but I have downloaded a copy from perl.com, and they don't seem to be
> > too much help - no doubt they are if you know what it is that you're
> > looking for, but I don't.
>
> ActivePerl also comes with all the docs, not only available from perldoc,
> but with your favourite handy-dandy web browser.  The "perlfaq" entry has
> a list of all the questions in the FAQ, and the section you can find them
> in.
>
> It appears the question in perlfaq5:
>
> How do I change one line in a file/delete a line in a file/insert a
> line in the middle of a file/append to the beginning of a file?
>
> is probably relevant here.  Just to keep it fresh, your question
> specifically is:
>
> > I am writing a perl script to be used as part of a CGI application. A
> > particular subroutine must read a text file into memory (I can do this)
> > and then cut a part of the file out and paste it into a second file.(I
> > can't do this)
>
> Assuming you mean "remove from the file" when you say "cut", then you
> want the "delete" part of the FAQ.  By "paste", I don't know what you
> mean.  Are you trying to:
>
> 1) Append to the end of an existing file
> 2) Prepend to the beginning of an existing file
> 3) Insert somewhere in the middle of an existing file
> 4) Create an entirely new file, whose contents are what you removed from
>    the first file.
>
> You may also want to look at the -i switch in perlrun.
>
> > I know what I want to do, but not what it is
> > called or how to do it.
>
> Could you please enlighten us as to what you want to do?  The problem
> with fuzzy specs is you get fuzzy answers.
>
> -=Eric




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

Date: Fri, 16 Jul 1999 20:48:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: bogus "used only once" message?
Message-Id: <37919a21.1045332@news.skynet.be>

Mark H. Wood wrote:

>       %jacks=(
>		"key1","value1",
>		"keyN","valueN",
>		);
>
>and then, in my main script:
>
>  do 'blah.pl' || die;
>
>The hash gets loaded just fine, but there's only one other occurrence
>of the name "jacks":
>
>  dosomething($jacks{$somekey});
>
>and the compiler doesn't like it:
>
>  Name "main::jacks" used only once: possible typo at myscript.pl line 42.

Then use it again.

	%jacks = ();
	do 'blah.pl' || die;
	dosomething($jacks{$somekey});

Or, for (future) strict-compatibility,

	use vars '%jacks';
	do 'blah.pl' ||die;
	dosomething($jacks{$somekey});

	Bart.


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

Date: Sat, 17 Jul 1999 04:17:15 +0800
From: "news.ust.hk" <babyh@forfree.at>
Subject: cgi compiler
Message-Id: <7mo41s$1l8@ustsu10.ust.hk>


Dear,
        Where can I find a CGI complier(work under windows)?
    As I want to change my program into byte code!
                                                    Thank you very much!
       Ck




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

Date: 14 Jul 1999 20:52:00 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Como ler un directorio...
Message-Id: <7mit9g$6ub$1@gellyfish.btinternet.com>

On Wed, 14 Jul 1999 13:41:13 -0400 Rodrigo wrote:
> Se puede hacer en perl que un script lea un directorio y guarde en un
> arreglo los nombres de todos los archivos que existen en dicho
> directorio??
> De ser asi... como se puede hacer???

Er sorry my Spanish isnt so good - do you mean something like:


#!/usr/bin/perl -w

use strict;
use File::Find;

my %directs;

find(\&wanted,'/home/gellyfish');

for (keys %directs)
{
  print $_,"\t",$directs{$_},"\n";
}

sub wanted
{
  $directs{$File::Find::dir}++ if -f $_;
}

If you want the sizes instead you will want to have a 'wanted' with:

  $directs{$File::Find::dir} += -s if -f $_;

Hope that helps

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 16 Jul 1999 19:37:22 GMT
From: paul_rahe@cissc.canon.com
Subject: Re: date_command in NT
Message-Id: <378f89dd.17791292@news.canon.com>

The localtime command can be used to retrieve the current date.

On Fri, 16 Jul 1999 21:10:34 +0300, "Elvar Ojar" <elvar@tamula.edu.ee>
wrote:

>Well, my english is not best but I try. I have guestbook that works well but
>have some problems also. This guestbook was meant to use with Linux but I
>have NT. So, where is command that puts date to the homepage with other
>info. $date_command = /usr/bin/date"; It dosent work with NT, but is it
>possible, and if it is then how?
>
>Elvar Ojar
>
>
>
>



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

Date: 16 Jul 1999 15:26:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: die ?
Message-Id: <slrn7ov5b8.c9j.abigail@alexandra.delanet.com>

Ian Mortimer (ianmorty@nortelnetworks.com) wrote on MMCXLV September
MCMXCIII in <URL:news:378F0C4A.F96BDF92@nortelnetworks.com>:
`` Hi all,
`` 
`` Bit of a problem with die - 
`` 
`` I am running a script that reads in data from a file and spits out the
`` selected data to the browser.
`` 
`` I open the file using -
`` 
`` open (CHANGED ,">$copy_file") || die "Couldn't open $copy_file \n";
`` 
`` What happens when there is a problem with that file ? - all I get is the
`` html stopping at the point of the open() line.  Does the die() command
`` only output the error message when perl is executed from the command
`` line ?

No. Unless you tell Perl otherwise, it will write die messages to
stderror. Now, of course, some other process might be calling your
Perl program and doing something with stderror, but that's beyond
the scope of this group.

`` PS: Yes Abigail, I *have* read the FAQ !

Include the CGI one?



Abigail
-- 
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'


  -----------== 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: 16 Jul 1999 15:13:11 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Exclusive range operator ( ... )
Message-Id: <x7yaggjtmg.fsf@home.sysarch.com>

>>>>> "PT" == Phil Tomson <ptkwt@user2.teleport.com> writes:

  PT> if( /^begin/ .. /^end/ ) { print $_; }

no need for $_ as that is the default thing to print

  PT> begin
  PT>    otherstuff
  PT> end

  PT> if( /^begin/ ... /^end/ ) { print $_;}

ditto.

  PT> begin
  PT>    otherstuff
  PT> end

  PT> What is the difference between .. and ... ?

another high quality question. will wonders never cease in this group!

first, the camel is not an authoritative source (see below) so read the
online docs for the last word on all operators.

there is only a small difference between .. and ... ( this paren is to separate
the sentence . from the operator). .. will can true and false on the
same line of text. if the line matches both operands of .. it will be
printed.

what ... does is force another line to be read (actually if forces
another evaluation of the ... operator) before it can toggle its
state. this means that the start and end lines can't be the same line.

what you want is to skip the marker lines altogether. this can be done
by using the return value of .. (and ...) which is rarely mentioned here
but very valuable. .. returns the iteration number in the current
sequence of evaluations of .. which is equivilent to the line number of
the range. so you can skip the first line but see if the return value is
== 1. but how do you skip the last line without another regex? perl has
another little trick up its long sleeve. the last number in the current
range (when the right operand of .. returns true) is in exponential
notation so you can check for the letter e inside it.

if ( $range = /^begin/ .. /^end/ ) {

# skip marker lines
	next if $range == 1 ;
	next if $range =~ /E/ ;

	blah blah ...


  PT> There doesn't seem to be anything about the exclusive range
  PT> operator in the Camel book.

because it wasn't in the language when the camel was written. i don't
know which perl version first had it but it is documented in 5.004_04.

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: 16 Jul 1999 13:16:05 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Exclusive range operator ( ... )
Message-Id: <378f84f5@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    ptkwt@user2.teleport.com (Phil Tomson) writes:
:What is the difference between .. and ... ?
:There doesn't seem to be anything about the exclusive range operator in
:the Camel book.

Sure there is:

        In a scalar context, \f(CB..\fP returns a boolean value.
        The operator is bi-stable, like an electronic flip-flop, and
        emulates the line-range (comma) operator of \fIsed\fP, \fIawk\fP,
        and various editors.  Each scalar \f(CB..\fP operator maintains
        its own boolean state.  It is false as long as its left operand
        is false.  Once the left operand is true, the range operator
        stays true until the right operand is true, \fIafter\fP which
        the range operator becomes false again.  (The operator doesn't
        become false until the next time it is evaluated.  It can test
        the right operand and become false on the same evaluation as the
        one where it became true (the way \fIawk\fP's range operator
        behaves), but it still returns true once.  If you don't want
        it to test the right operand until the next evaluation (which
-->     is how \fIsed\fP's range operator works), just use three dots
-->     (\f(CB...\fP) instead of two.)  The right operand is not evaluated
        while the operator is in the "false" state, and the left operand
        is not evaluated while the operator is in the "true" state.


Is that clear enough?  It's not the "exclusive" thing you think it is.

--tom
-- 
 If at first you don't succeed, try reading the fucking manpage.


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

Date: 16 Jul 1999 13:39:51 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Exclusive range operator ( ... )
Message-Id: <378f8a87@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Uri Guttman <uri@sysarch.com> writes:
:first, the camel is not an authoritative source (see below) 

Oh, please.  Not this again.  Did you even *look* in the Book?

--tom
-- 
pi seconds is a nanocentury.
                --Tom Duff


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

Date: 16 Jul 1999 15:44:17 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Exclusive range operator ( ... )
Message-Id: <x7pv1sjs6m.fsf@home.sysarch.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

  TC>      [courtesy cc of this posting mailed to cited author]
  TC> In comp.lang.perl.misc, 
  TC>     Uri Guttman <uri@sysarch.com> writes:
  TC> :first, the camel is not an authoritative source (see below) 

  TC> Oh, please.  Not this again.  Did you even *look* in the Book?

well, ... is in the section on .. (p 90-91) but not in the index. i was
scanning the text to fast to see ...

in either case, my post did answer the actual problem and ... was not
useful.

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: Fri, 16 Jul 1999 19:24:00 GMT
From: mchesler@my-deja.com
Subject: executing commands, command-line vs. browser
Message-Id: <7mo0s2$oh4$1@nnrp1.deja.com>

I'm trying to write a CGI app that does a lot of processing.  If I just
run it through, the browser times out.  I figured that the best way
would be to spawn a new process to perform the processing and redirect
the user to a page that continually checks to see if the process is
finished.  It works like this:

script(redirect)-
                 |
                 |-script(run)
                 |-redirect

The second instance of the script writes to a file.  The redirect script
checks for a specific comment in that file and displays the file if the
comment is present.  Otherwise, it redirects to itself.

Here's the problem.  When I run the script from the command line (as
root, or nobody), it works fine.  When I try to run it from a browser,
the script(run) part isn't executed correctly.  As far as I can tell,
the problem is with passing arguments to the script on the command line.
 When it's run in a browser, the command line doesn't take the
arguments.  Please help.

--
Matt Chesler
Sun Microsystems - SPA
mchesler@East.Sun.COM
(781)442-2753


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


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

Date: 16 Jul 1999 14:38:06 -0500
From: jzeitlin@cyburban.com (Jeff Zeitlin)
Subject: Re: FAQ 5.7: How can I use a filehandle indirectly?
Message-Id: <37b38c1c.335466896@news.cyburban.com>

Mark Summerfield <m.summerfield@ieee.org> wrote:

>Tom Christiansen wrote:

>> I don't meant to be judgmaticalistical and call it super invalidy
>> in vurry ripped and clipped jargon, but it's just not a decentish or
>> statusy thing to be writing thusly in the bettermost fora.  Sure, that
>> kind of phrasey lingo might thusly sound more come-at-able to some of
>> the more swellish kiddies, but it's a ratherish shambolic stunt that
>> thusly leaves the vurry, vurry nicey reader in search of something, well,
>> moreish; you know, something a tad more primmy and prestigey.  It's hard
>> to avoid getting an ucky taste all-overish when thusly stumbling through
>> twistical turns of tongue.  Yes indeedy, Bob!

>This is English translated into Hugh-Grant-ese, right?!

Either that or a Nadsat dialect...
--
Jeff Zeitlin
jzeitlin@cyburban.com


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

Date: Fri, 16 Jul 1999 19:15:35 GMT
From: ronan.cremin@isocor.com (Ronan Cremin)
Subject: glob("*.*") gives "File not found message" on NT
Message-Id: <378f8411.1385046301@news.isocor.com>

A simple script containing only the following line

my @array = glob("*.*");

gives me

"The name specified is not recognized as an
internal or external command, operable program or batch file."

on my NT 4 machine. I'm using Perl 5.004_02

Is this a file association problem?

Any ideas would be appreciated.

Thanks.
rc


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

Date: Fri, 16 Jul 1999 06:13:22 +0100
From: Jason <jason@killdare.demon.co.uk>
Subject: Re: I need to hide the source
Message-Id: <KSobmBAy9rj3Ewtl@shambolica.freeserve.co.uk>

In article <7lvsff$fuo$1@nnrp1.deja.com>, rdosser@my-deja.com writes
>Odd request here - I need to write a script in perl, but somehow encrypt
>or encapsulate the source in a binary so that other users on the host -
>including root - cannot read it.
>
>Any thoughts?
>
>Thanks,
>Ralph Dosser
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

Try the ice planet "Hoth", I know the force was there for a while,
hiding out in a secret, rebel base.

May the source be with you.

OK, sorry, I'll go away now.
-- 
Jason@shambolica.freeserve.co.uk


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

Date: 16 Jul 1999 19:08:09 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Linux - Apache - Perl
Message-Id: <slrn7ov0t1.lpe.fl_aggie@thepentagon.com>

On Fri, 16 Jul 1999 15:41:35 GMT, JT <jett1not@homedot.com>, in
<37964dda.86727328@24.2.0.71> wrote:

+ Well, what you wish for is a perfect usenet which doesn't exist.

And your point is? Not knowing Usenet conventions isn't a crime,
particularly since ISP's tend to throw their newbies to the wolves.
They ain't going to learn nothing if they aren't told.

+ Policing and reprimanding off-topic posters is to treat them as
+ children. Being deliberately non-helpful is not my style.

Pointing them to the appropriate newsgroup isn't helpful? Excuse me?

+ If it works
+ for you that's fine, but why waste the time even scolding these
+ posters, why not just boycott them entirely until they go away?

That helps *how*, exactly? If they remain willfully ignorant, then
I can *plonk* 'em.

+ It sounds like a bit of a power trip on your part judging from your
+ selection of words such as "reward" and "inappropriate hubris".

Not really. I know what I know about perl 'cause I went out and bought
books, and sat down and read/skimmed them, and tried the examples, and
played with things and then applied them to my projects. If I can do that,
most everyone can. I'm not above average, so I figure if I can do it,
so can anyone else.

+ Waving experience over
+ your head by telling people to "Read the FAQ" with no further
+ explanation, is just plain bullshit.

What's wrong with it? HAVE YOU READ THE FAQ? Do you know what it
contains?  See, I've been in this sort of arguement before...I
would guess that at most, you have some passing familiarity with
the FAQ. The FAQs have been looked at by hundreds, nay thousands,
potentially millions of people. The answers there are about as 
bullet-proof as you're going to find.

Further, the FAQ comes in every decent distribution of Perl. Its on
your disk. You don't have to post to the newsgroup, wait for a response,
and then wonder if it is correct...

+ and allow someone else to help answer their question.

Ah, but are you going to get the right answer? see, if I point you to
the FAQ, I don't have to worry about being factually correct, as long
as I get the right FAQ.

+ The people who are
+ in-the-know don't need to humiliate and insult the people who are
+ trying to learn. 

They'll look much smarter when they know to check the FAQ before
posting. Or are you saying that it is valueless to do so?

+ Is it okay if I ask a question that
+ makes you think but not if I ask a common "frequently asked question"?

Yes. It shows inappropriate laziness or ignorance. We can cure the later,
but the former requires more time.

+ Now *that* is a double standard.

Not hardly. This isn't comp.lang.perl.helpdesk...if it where, you'd have
a point. But it ain't.

Next, you'll accuse me of being patronizing...

James


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

Date: 16 Jul 1999 14:48:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Linux - Apache - Perl
Message-Id: <slrn7ov336.c9j.abigail@alexandra.delanet.com>

JT (jett1not@homedot.com) wrote on MMCXLV September MCMXCIII in
<URL:news:37964dda.86727328@24.2.0.71>:
,, 
,, Well, what you wish for is a perfect usenet which doesn't exist.
,, Policing and reprimanding off-topic posters is to treat them as
,, children. Being deliberately non-helpful is not my style. If it works
,, for you that's fine, but why waste the time even scolding these
,, posters, why not just boycott them entirely until they go away?


X:  "Why are you swatting the walls with a newspaper?"
JT: "There are mosquitos in the bedroom."
X:  "Why don't you just boycott them entirely until they go away?"



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== 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: 14 Jul 1999 21:08:43 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Linux - Apache - Perl
Message-Id: <7miu8r$6uh$1@gellyfish.btinternet.com>

On Wed, 14 Jul 1999 16:25:24 GMT JT wrote:
> On 13 Jul 1999 01:30:44 -0500, abigail@delanet.com (Abigail) wrote:
> 
>>I wonder what's worse. People asking totally off topic questions, or
>>people answering off-topic questions, rewarding the posters of off topic
>>questions.
>>
> I've noticed that you answer quite a lot of "off-topic" questions.
> Maybe you should consider passing them by if you have nothing of any
> real value to contribute. We are not all gurus, in fact as a Perl
> "newbie" I learn a lot from even the simplest questions.

People 'answer' the off-topic, the FAQ and the plain stupid lest people
develop the idea that it is alright to ask them here - of course there
will always be the 'helpful' ones who give the impression that it *alright*
to ask these questions thus making things worse ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 16 Jul 1999 14:54:04 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: long explanations wearying (was Re: Top 10 responses)
Message-Id: <slrn7ov3dt.c9j.abigail@alexandra.delanet.com>

Mats Pettersson (mats.pettersson@falukuriren.se) wrote on MMCXLV
September MCMXCIII in <URL:news:378F0D84.8754CC6C@falukuriren.se>:
--
-- Technically you are right, but as i said many cgi scripts seems to be
-- written in perl and sometimes it is annoying asking questions in
-- two/three different newsgroups when the answers is used in the same app
-- (if you understand what i mean).

But they will be different questions anyway. If I have problems with a
Perl program that uses Sybase and gnuplot, and I've questions about the
Sybase, gnuplot and Perl parts, I've 3 questions. Which would require
3 postings anyway. Is typing 'comp.lang.perl.misc' three times so much
more convenient than typing 3 different newsgroups names?

If people can't even figure out where the question belongs, they are
in way over their heads anyway, and should not try to combine multiple
things they don't understand. They shouldn't be seeking help on usenet,
but they should take one or more classes.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== 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: 16 Jul 1999 14:54:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: MYSQL - Help
Message-Id: <slrn7ov3f7.c9j.abigail@alexandra.delanet.com>

Jay Flaherty (fty@hickory.engr.utk.edu) wrote on MMCXLV September
MCMXCIII in <URL:news:7mn8de$k2u$1@gaia.ns.utk.edu>:
'' Abigail (abigail@delanet.com) wrote:
'' : 
'' : That's not very SQL like. You're stuck in limited sequencial world.
'' : The S in SQL stands for _Set_. Think setlike. SQL is a very powerful,
'' : 
'' 
'' I thought the  "S" in SQL stands for Structured?


That's the other SQL.


Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== 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: Fri, 16 Jul 1999 20:53:30 GMT
From: avong4360@my-deja.com
Subject: netout: Broken Pipe Error
Message-Id: <7mo644$qpd$1@nnrp1.deja.com>

Does anybody know what causes this error.  We had
an interface program using sybperl that inserts records into
tables after selecting the records from another database
We received the error "netout: broken pipe", any clues would help
thanks in advance
-AVG


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


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

Date: 16 Jul 1999 19:15:39 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: Padding numbers with 0's
Message-Id: <7mo0cr$l5p$1@campus1.mtu.edu>


Forgive me for what seems like such a simple question, but whats
an easy way to pad 0 (zero)'s infront of a number. The specific
example I'm using if for in the following...

$year = ( $_ = (localtime)[5] > 75 ) ? "19$_" : "20$_";

but if the year is 2001, it comes back as 201.
Another place where I need this is for displaying the day of
the month.

printf "%4d%2d%2d\n", $year, $month, $day;

Any help is appreciated.

Jason



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

Date: Fri, 16 Jul 1999 13:24:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Padding numbers with 0's
Message-Id: <MPG.11f934fa80da4a6a989ce6@nntp.hpl.hp.com>

In article <7mo0cr$l5p$1@campus1.mtu.edu> on 16 Jul 1999 19:15:39 GMT, 
Jason Stapels <jmstapel_n0spam@mtu.edu> says...
> 
> Forgive me for what seems like such a simple question, but whats
> an easy way to pad 0 (zero)'s infront of a number. The specific
> example I'm using if for in the following...
> 
> $year = ( $_ = (localtime)[5] > 75 ) ? "19$_" : "20$_";
> 
> but if the year is 2001, it comes back as 201.

That's because assignment has lower precedence than comparison.  Your $_ 
is getting the Boolean value of the result of the comparison, which is 0 
or 1.

Now, if you correct the precedences by moving the right parenthesis, 
your result will be '20101'.  Not that that's any better than '201', is 
it?

Did you bother to read the documentation for the localtime function 
before posting this question?  It will tell you what to do.  Hint:  It's 
a lot simpler than the stuff you posted.

> Another place where I need this is for displaying the day of
> the month.
> 
> printf "%4d%2d%2d\n", $year, $month, $day;

The format '%.2d' forces at least two digits, with a leading zero to pad 
to two digits if necessary.  This is discussied in the documentation for 
the sprintf function.

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


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

Date: Fri, 16 Jul 1999 14:21:29 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: PDF-TXT
Message-Id: <378F8639.BC6BE727@mail.uca.edu>

Jordan Hiller wrote:
> 
> [snip]
> "54686973206973206E6F742061205065726C207175657374696F6E2E20536" .
> "565206120504446206E65777367726F75702E";

It is if he is looking for Text::PDF, found on CPAN, or the Perl
programs available at SANFACE.com.

Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


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

Date: Fri, 16 Jul 1999 15:26:01 -0400
From: Burton Kent <burton@lucent.com>
To: Walter Tice USG <tice@hunch.zk3.dec.com>
Subject: Re: Perl before Swine?
Message-Id: <378F8749.205E2E84@lucent.com>

This is the best response yet, but from my manpage on
nice:

 The super-user may run  commands  with  priority
 higher than normal by using a negative increment
 such as --10.  A negative increment assigned  by
 an unprivileged user is ignored.

I'm not allowed to be less than nice.  Bummer.

B

Walter Tice USG wrote:
> 
> In article <378E3BDE.1AA8CE34@lucent.com> Burton Kent <burton@lucent.com> writes:
> >How do I make Perl grab/conserve all the memory it can?
> >My program needs a lot more memory for recursion...
> >
> >Burton
> 
> Perl is an unconstrained memory hog unless you set limits (i forget
> the command), or your code isn't fast, or it doesn't do much,
> there are several short scripts over at:
> 
> http://www.c-lab.de/~sb/Perl-Limericks.html#Pipes
> 
> which demonstrate how much and how quikly Perl can monopolize memory.
> 
> another aspect of your question can be answered by running the script
> in Unix as root like so "nice -20 mykillerscript.pl"  this will give
> your process(s) the highest priority over everything else, but be
> careful, such a tool is easily blunted by misuse, or if you share a
> system with other people, they may take up arms!
> 
> W


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

Date: Fri, 16 Jul 1999 21:00:18 GMT
From: Darrin H <dthusma@home.com>
Subject: perl ftp module
Message-Id: <378FA091.B5B417E9@home.com>

I cannot seem to get the put or the append to work on this module.
Does anyone have the same problems, or a working example?



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

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". 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 V9 Issue 169
*************************************


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