[6811] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 436 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 5 20:07:28 1997

Date: Mon, 5 May 97 17:00:21 -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, 5 May 1997     Volume: 8 Number: 436

Today's topics:
     > 2GB "file too large", AIX 4.2, perl 5.001, not "ulimi (Bob Shair)
     Re: [DRAFT] RFD: comp.lang.perl reorg (A. Deckers)
     adding to an array within a while(<>) (sdm)
     Re: adding to an array within a while(<>) (A. Deckers)
     Definition of $<digit> in perlvar.pod (John L. Allen)
     Extracting Data from file and outputting in a record <stockman@rdbewss.redstone.army.mil>
     Re: File Descriptors <mishra.aditya@emeryworld.com>
     Re: How to do a "less" on a file. <anirvan@crl.com>
     I'm curious...  What the "o" switch is for in s/// <houde@fox.cisti.nrc.ca>
     Re: I'm curious...  What the "o" switch is for in s/// (A. Deckers)
     IlyaZ OS2 perl and PDKshell (whams)
     Re: moderation (Steffen Beyer)
     Modifying D-Base fields with PERL. Jeremy_Fuller@rocketmail.com
     Re: Modules/Packages in Perl (Randy J. Ray)
     New Perl programmer in need of tutorials <kosborne@rocketmail.com>
     Re: Perl auto-replier (Chipmunk)
     Perl Books : cross-platform perl && perl-how-to ?> <Clint.Eastwood@spaghetti.westerns>
     Perl debugger limitation... <grimaldo@iaehv.nl>
     Re: Perl or 'C'???? (I R A Aggie)
     potential bug in Perl 5.003 garbage collection (Curtis Hrischuk)
     Reading data from a file and outputting to another file <stockman@rdbewss.redstone.army.mil>
     Re: scalar holds compiled code (Tom Vaughan)
     Re: Script runs fine from shell, but browser doesn't re (A. Deckers)
     Singles and doubles <mrchristopher@inorbit.com>
     system commands and CGI woes (Mike)
     Re: Urgent help needed!  State abbreviation conversion (Tung-chiang Yang)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 May 1997 20:01:20 GMT
From: rmshair@uiuc.edu (Bob Shair)
Subject: > 2GB "file too large", AIX 4.2, perl 5.001, not "ulimit"
Message-Id: <5kleag$bul@vixen.cso.uiuc.edu>

I'm running a perl (5.001) script on AIX 4.2 which receives files from 
a mainframe (over a TCP socket) and writes them to disk.  When writing
to a large_file_enabled filesystem, the program died at 2GB with:
Sustem write error: File too large
(yes, that's a "u" in Sustem").

The user filesize limit is "unlimited".
I can create a file >2GB with "cat" as this user in the target filesystem.

Can this be a limit in the perl interface to the C library?
How can I circumvent it?

Thanks in advance,
-- 
Bob Shair                          Open Systems Consultant
1018 W. Springfield Avenue         rmshair@uiuc.edu
Champaign, IL 61821		   217/356-2684
< Not employed by or representing the University of Illinois >


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

Date: 5 May 1997 21:35:15 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: [DRAFT] RFD: comp.lang.perl reorg
Message-Id: <slrn5mskkj.9b.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	sb@en.muc.de wrote:
>Can you tell me a way to TRIVIALLY circumvent the moderator of
>comp.infosystems.www.announce?

Net.kooks do it all the time, though not necessarily in that group. No,
I'm not going to tell you how to do it. The information is publicaly
available in the relevant RFC.

Of course, she'll cancel any unauthorised article as soon as she sees
it, and you would be frowned upon by a great many Useneters if you did
this, but that's a separate issue.

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>


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

Date: 5 May 1997 19:12:55 GMT
From: sdm@red.seas.upenn.edu (sdm)
Subject: adding to an array within a while(<>)
Message-Id: <5klbfn$hj4@netnews.upenn.edu>

Is there a way to easily add to an @array each pass through a while() loop,
without the next pass obliterating what was there on the previous pass?
Everything I find in my books seem to bypass/overlook this.....

thanks,


 ..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..- 
steve.m.
Unix Pronounciation Guide       http://st2184.tc.tufts.edu/
Research Associate              Penn netnews junkie             \ /
GTELabs                         Tufts undergraduate             [o]
superpages project              engineering psychology dept.     |
http://superpages.gte.net       "That drone from sector 7g"     _|_

! Set this to false to disable the <BLINK> tag.
*blinkingEnabled:		True


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

Date: 5 May 1997 20:54:28 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: adding to an array within a while(<>)
Message-Id: <slrn5msi84.9b.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	sdm@red.seas.upenn.edu wrote:
>
>Is there a way to easily add to an @array each pass through a while() loop,
>without the next pass obliterating what was there on the previous pass?
>Everything I find in my books seem to bypass/overlook this.....

Did you read the FAQs or the documentation before posting your
question? Methinks you didn't. Bad, bad.

while (<>) {
	$len = push @ary, $_;
}

or

while (<>) {
	$len = unshift @ary, $_;
}


And please trim your signature and use a cut line.

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>


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

Date: 5 May 1997 17:49:58 -0400
From: allen@gateway.grumman.com (John L. Allen)
Subject: Definition of $<digit> in perlvar.pod
Message-Id: <5klkm6$ni9@gateway.grumman.com>


I've been trying to understand something that a fine perl-porter has
been trying to learn me, and so far I just can't get it.  What should
the outputs of

	1. perl -e '$_="abcd"; /(?:(b)|(c))*/; print "$1:$2:$3:$4\n"'
	2. perl -e '$_="abcd"; /((b)|(c))*/; print "$1:$2:$3:$4\n"'

be, and how does their behaviour relate to this paragraph in perlvar.pod

	=item $<digit>

	Contains the subpattern from the corresponding set of parentheses in
	the last pattern matched, not counting patterns matched in nested
	blocks that have been exited already.  (Mnemonic: like \digit.)
	These variables are all read-only.

With perl5.003_99, they both print ':::', clearly a bug.  If the 'a' is
removed from $_, #1 gives ':c::' and #2 gives 'c::c:'.  I frankly don't
know _what_ the above paragraph is trying to say, but was told the
answer lies there.

Burning in Perl Hell,

John.




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

Date: Mon, 05 May 1997 17:48:46 -0500
From: Gaylon Stockman <stockman@rdbewss.redstone.army.mil>
Subject: Extracting Data from file and outputting in a record
Message-Id: <336E63CE.41C6@rdbewss.redstone.army.mil>

Disclamier - I am trying to learn Perl.

 I can write this in a higher language w/o a problem, but since
I am trying to learn Perl - I would like to try this method.

 I have the camel and llama books - been there done that on
trying to extract examples.

 I would like to write a Perl script that will read in a specified
input file, find a string that says START_VEHICLE_PARAMS, read the
first three lines, find another string that says ENUMERATION TYPE,
get data before that string (on same line), print all of the
gathered info to a file, then start over looking
for the START_VEHICLE_PARAMS string until I get to the end of the
file.  I have managed to get some of the info required but am
having trouble extracting the fields and outputting to a file
properly. Below is a stripped sample of the input data. Below
that is what I am trying to output to a file.

 I know that this should be extremely simple in Perl. Maybe I am
trying to make it too complicated. The input data file is actually
fixed currently - but is likely to change. The  first three record
positions should remain constant - but could key off of the description
field - maybe ??


 Could someone please provide some starter info and explanation of
what is the best way to accomplish this ??
 Any help is greatly appreciated.

**** INPUT FILE ***

 .
 .
 .
!---------  START_VEHICLE_PARAMS   --------
  1                            'TYPE INDEX'
  'BIG_CAR'                     'VEHICLE DESCRIPTION'
  'CADDY'                       'VEHICLE CLASS DESCRIPTION'
  'BOSE_RADIO'                  'COMM DEVICE DESCRIPTION'
  1                             'NUMBER OF RADIOS ON VEHICLE'
  'BRIGHT_BEAM'                 'HEADLIGHT TYPE(S) ON VEHICLE'
  2                             'NUMBER OF WEAPON PLATFORMS ON VEHICLE'
  'BIG_WHEELS'   1  34  24  7
  'SNIPER (AT-11)' 1  6   1  7
 .
 .
 .
    F,T,F                       'YES, NO, MAYBE'                    
    1 1 222 1 1 0 0             'ENUMERATION TYPE'
 .
 .
 .
 F,T,T                         'YES,NO,MAYBE'

  ------   START_VEHICLE_PARAMS   --------
  2                             'TYPE INDEX'
 

*** Output FILE ****

Number    Index   Descr       Class     Enumeration
1         1       BIG_CAR     CADDY     1 1 222 1 1 0 0
2         2       BIG_TRUCK   F150      1 2 225 3 1 4 0


-- 
Gaylon Stockman

stockman@rdbewss.redstone.army.mil


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

Date: Mon, 05 May 1997 10:44:23 -0700
From: "A. Mishra" <mishra.aditya@emeryworld.com>
Subject: Re: File Descriptors
Message-Id: <336E1C77.138F@emeryworld.com>

Jordyn A. Buchanan wrote:
> Just a thought:
> 
> Your shell usually puts limits on these things.  Have you used something
> like ulimit (sh) or limit (csh) to raise the shell's default limit?

I have raised the descriptor limit to 1024(ulimit -n shows 1024)
The odd thing is it happens with sockets only.

Adi


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

Date: 5 May 1997 23:08:00 GMT
From: Anirvan Chatterjee <anirvan@crl.com>
Subject: Re: How to do a "less" on a file.
Message-Id: <5klp8g$boo$1@nnrp1.crl.com>

-----BEGIN PGP SIGNED MESSAGE-----

Jordyn A. Buchanan <jordyn@bestweb.net> wrote:
: Programs like less exist for the purpose of handling data from other
: programs.  The logical thing seems to be to not worry about how your data
: looks, dump it to STDOUT and allow people to use less or more or whatever
: they want to look at it.

Depending on the implementation, dumping to $ENV{'PAGER'} || "less"
might be an appropriate way of dumping long output to screen, while
still allowing the user to choose a pager via the PAGER env. var.

_______________________________________________________________
Anirvan Chatterjee . anirvan@crl.com . <URL:http://www.mx.org/>
PGP 0x93C5C165 . finger for PGP/geek . encrypted mail preferred
http://www.mx.org/bookfinder/ : online book comparison shopping 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM25n4mTQ0LuTxcFlAQFN+wP9GERDwsOpA9vK0M7O2Wep9goufvP4NgW1
YCJ0X8xsHRhRVyKXbsJZsISq1qP3EgRBNgmYzqa5u8zfNmDqE11Ioar63pUOpfDc
rK3kjvKaGvnkufM4PvAOkW5lTCcQxUCJYz5tvOEU2bIWMbIZT8pDwzfEuFKHsl1R
/uvf16+IcPc=
=jxah
-----END PGP SIGNATURE-----


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

Date: Mon, 05 May 1997 14:16:03 -0400
From: Pascal Houde <houde@fox.cisti.nrc.ca>
Subject: I'm curious...  What the "o" switch is for in s///
Message-Id: <336E23E2.DAD4294F@fox.cisti.nrc.ca>

I'm interpreting another's program and I saw it was using the "o" option
in s/// but I cannot figure out what it does special.  I even read in
the Perl book but it's not trivial.  Can you explain it to me what it
does with an easy example.

Thanks in advance.
-PH-



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

Date: 5 May 1997 21:47:56 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: I'm curious...  What the "o" switch is for in s///
Message-Id: <slrn5mslcc.9b.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	houde@fox.cisti.nrc.ca wrote:
>I'm interpreting another's program and I saw it was using the "o" option
>in s/// but I cannot figure out what it does special.  I even read in
>the Perl book but it's not trivial.  Can you explain it to me what it
                   ++++++++++++++++
>does with an easy example.

It is if you read the documentation and the Blue Camel book (pp.
57ff.), and I'd bet my bottom dollar (er, pound sterling) that this is
covered in the FAQ.

It means "compile this pattern only once", ie you are promising the
compiler that the pattern will not change while the program is
running.

<URL:http://www.perl.com/CPAN/doc/>.

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>


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

Date: 5 May 1997 22:34:28 GMT
From: whams@xs2.xs4all.nl (whams)
Subject: IlyaZ OS2 perl and PDKshell
Message-Id: <5kln9k$ca0$1@news0.xs4all.nl>
Keywords: IlyaZ perl port, DOS, PDKshell


Problem: _DOS_ Perl Scripts using the Shell.

Hello.

I'm using Ilya Zakharevitch's PERL5.003_93 OS2 port under
MS-DOS6.20, with 4DOS5.50 as the DOS commandline processor;
RSX 5.10 works as the 32-bit DOS extender running under the
CWSDPMIv.0.9 DOS DPMI-server;
As a Shell I'm using the PDKSH port from Ilya's FTP directory.

All of these programs, when started separately, seem to work as
they should!

The PERL_SH_DIR environment variable is set to E:/PERL/BIN, which is
also where PERL.EXE and RSX.EXE live, and which is in the PATH.

As far as I can see, this is conformant to Ilya's prescriptions in
his README.os2.

Everything works fine - even fork() - but I'm having a bad time time
trying to use the shell from within a perl script, as in these examples:

__BEGIN__
#!/usr/bin/perl -w

$test = system q{c:\\4dos\\4dos.com /c dir};
print $test;
exit;
  # actually shows the DIR listing, but then prints:
  # can't spawn e:/perl/bin/sh.exe : function not implemented
  # at e:\perl\bin\perltest.pl line 3
  # 65280

#$test = system `dir`;
#print $test;
#exit;
  # proces 3 get hardware fault 13 (general protection) at 7DCF
  # writing core file
  # Process terminated by SIGSEGV
  # -1

# print system q/c:\dos\command.com/, q/\/c/, q/dir/;
  #SIGKILL etc
# print qx/dir/;
  #SIGSEGV and core dump as in second example
__END__

I would be very grateful if someone could provide me with a hint
at just why SH.EXE doesn't work properly from PERL, whereas from the
commandline it _does_ seem to function.

PS: I'm stuck with DOS, because at my work I can't install LINUX :-(

Thanks a lot in advance,

                wim                                       =
                                                          =
             w.j.m. van der hamsvoord                     =
    - - - whams@xs4all.nl - = - - - - - - - - - - - - - - = - - - - -
                                                          =



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

Date: 5 May 1997 18:33:55 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: moderation
Message-Id: <5kl96j$t78$1@en1.engelschall.com>

Douglas Seay <seay@absyss.fr> wrote:
> > I think this is better than the authoring.cgi-newsgroup policy that just
> > sends you the FAQ the first time you post, and then gives you free access:
> > that wouldn't reduce the high noise/signal ratio, IMHO.

> I don't follow many robo-moderated groups, but just sending a FAQ and
> still posting wouldn't seem to do much.  Automatically allowing a second
> posting would allow someone to repost the same thing twice to ensure
> that one of them actually made it.

That's exactly why I'm against it. :-)

> Someone (Eli the Bearded, I think, my server has already expired the
> article) commented that he moderated a group and if something was
> vaguely on-topic, he allowed.  This is what I want.  I just want to
> weed-out a few off-topic posts (CGI stuff is almost always off-topic, as
> is Make Money Fast).  A robot might be able to do this, but hopefully by
> doing more than just simply looking for words.

Exactly.

> Another strange idea: would it be good for a moderator (human or
> otherwise) allow everything to be posted to comp.lang.perl.misc and if
> someone is on the approved list, automatically cross post to
> comp.lang.perl.filtered?  The approved list now wouldn't say who could
> post, but who would be cross-posted.  Using this scheme it would be
> possible for those who want to look at everything to do so, but for
> those of us who want a "lean-n-trim" perl discussion to follow the
> highlights on c.l.p.filtered?  I wouldn't think that this would increase
> the network load for the perl newsgroups, but it might require a bit
> more bookkeeping by the newsservers.

I'm not sure if anyone would like to post to both groups - everyone could
read both groups if he so wishes, so why implement extra functionality to
allow this kind of cross-posts?

Anyway, the other way round probably works anyway: if you post to
clp.moderated and cross-post to clp.misc at the same time, it will
also show up there if it's accepted for clp.moderated.

Or am I mistaken?

> > > Maybe also build some
> > > sort of Perl test, and if someone can score well enough (knows the
> > > basics), then let them on the list.
> > 
> > Frankly, I think this is a bad idea.

> Why?  My idea was that if someone knew the basics of Perl, let 'em post
> without bothering the moderator(s).  The rule for being on the "approved
> list" would be to pass this test _OR_ have a moderator approve three
> posts.

I (and probably many other people) don't like the idea of passing a "test"
to gain access to a certain newsgroup.

There have been more tests in my scholar career than I can count, I'm kinda
tired of it! :-)

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Mon, 05 May 1997 15:11:50 -0600
From: Jeremy_Fuller@rocketmail.com
Subject: Modifying D-Base fields with PERL.
Message-Id: <862862948.23367@dejanews.com>

To Whom It may Concern,

I was wondering if anybody could help me out on a database question
pertaining to the PERL programming language.  What I want to do is MODIFY
a Database field when a link is followed or clicked.

This is an Example:

name|address|city|state|phone|fax|CODE
Jeremy Fuller|123 Vr. Lane|Ogden|CA|85560|555-6672|555-7894|RED

I would like to MODIFY CODE "RED" to CODE "BLUE".  How can I accomplish
this using Perl?  Any information you can supply would be appreciated.

If you can, Please e-mail me at Jeremy_Fuller@rocketmail.com (I don't
check Usenet very often).

Thank you,

Jeremy Fuller
Jeremy.Fuller@rocketmail.com

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 05 May 1997 13:46:28 -0600
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: Modules/Packages in Perl
Message-Id: <uowyb9t8zxn.fsf@tremere.ecte.uswc.uswest.com>

stephen farrell <stephen+usenet@farrell.org> writes:
> "Neil D. Quiogue" <neil@iphil.net> writes:
> > 2. INC
> > 
> > use Exporter;
> > 
> > @ISA = (Exporter SuperClass);
> > 
> > require "/somedirectory/myConf.conf";
> > 
> > $INC{'$HOME/SuperClass.pm'} = 1;
> 
> yow.  Don't do this with @INC because (a) it is--or *was*, rather;)--
> an array, not a hash (b) it's weird.  Use
> 
> 	use lib "dir/ectory";
> 
> instead, or else the way I mentioned above.

Altering %INC and adding a directory to the search path are different beasts.

%INC and @INC are different variables-- the former maps loaded libraries to
their full paths. For example, if you "use English;", and your perl libraries
start at /usr/local/lib/perl5, then $INC{'English.pm'} will equal
"/usr/local/lib/perl5/English.pm". @INC, on the other hand, is an ordered
list of directories to search for requested libraries. This said, the use of
%INC above is still wrong, since '$HOME/SuperClass.pm' is not a good key (not
to mention that the quoting will supress expansion of $HOME, which the writer
probably meant to be $ENV{HOME} anyway), and "1" is not a good path for the
resolved location.

On the plus side, "use lib '/foo';" is the preferred method of adding dirs to
the search path.

Randy
-- 
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS         Phone: (303)595-2869
                Denver, CO                                     rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin
===============================================================================


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

Date: Mon, 05 May 1997 15:05:21 -0700
From: Katharine Osborne <kosborne@rocketmail.com>
Subject: New Perl programmer in need of tutorials
Message-Id: <336E59A1.38DD2938@rocketmail.com>

If anybody knows of any online tutorials on getting started with Perl
please email me.  It would be especially helpful if they were slanted
from C\C++ or Java, I've only had the barest minimum exposure to shell
programming.  Also please don't ask me to read the FAQ's from this
newsgroup, I've been down that road already.

Thanks in advance-
KaOs
kosborne@rocketmail.com



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

Date: 5 May 1997 22:05:26 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Perl auto-replier
Message-Id: <5kllj6$ldb$1@dartvax.dartmouth.edu>

In article <336DBD00.91D7A60@absyss.fr>
Douglas Seay <seay@absyss.fr> writes:

> > The ends don't justify the means.
> 
> Hurrah!  Please repeat this loudly to those folks whose "means" are
> usenet and whose "ends" are getting simple questions answered with as
> little work and thought as possible.

Hehe.  Good answer.

> I don't want to say that rudeness is the only way, but the hordes of
> unread newbies grows old quick.

And I ask again, will being rude solve the problem?
No, it won't.  No matter how rude you are, we will continue to have
newbies asking foolish questions.  As I see it, being rude gets you
nothing.

Chipmunk


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

Date: Mon, 5 May 1997 19:12:16 GMT
From: The Sixth Beatle <Clint.Eastwood@spaghetti.westerns>
Subject: Perl Books : cross-platform perl && perl-how-to ?>
Message-Id: <rjaE9q2oG.28w@netcom.com>


-----BEGIN PGP SIGNED MESSAGE-----

Hello,

I was recently checking out the foll books in the local
tech-book store :
(1) Cross Platform Perl
(2) Perl 5 How-To

Any comments of which is better ?
I have read the review on Cross-Platform Perl at
www.perl.com; they don't have anything on the second
book, though.

thanks for your time.

cheers

- --ronnie

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM24xBIzRxcPzf9fRAQGOWQP/eeZbKZRMT6dcYM1bETciTdmVDP2frAGo
S82b6fmmo+b+6oZsaMm4lNqe+PspVF3NyD/VFx+FKwBI9acN02j+X9cLZ26yrv+B
pPie3JC7Ylytzwgf4hcITNZSox2B+k1BYDbZ+9MeTRf99Nsojd1n08xma1TtqsOc
ix7vyH2lFz8=
=gr8D
-----END PGP SIGNATURE-----
-- 
Reply-To: rja[at]netcom[dot]com. ** PGP-encrypted email preferred ** 
PGP public key available by finger. Key/ID #: 1024/F37FD7D1 
PGPprint: 08 5A 4D 74 08 21 0F D0  CF AF 83 C0 5C 55 71 C0


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

Date: Mon, 05 May 1997 23:40:32 +0200
From: "D. Emilio Grimaldo T." <grimaldo@iaehv.nl>
Subject: Perl debugger limitation...
Message-Id: <336E53D0.3C07@iaehv.nl>

Hi,
   I was trying the Perl debugger (perl -d) via another program
using a Unix pipe, however not matter what I do, even if the
pipe is setup the output of perl5db.pm always kind of flows
out of the pipe instead of inside the pipe to use some plumbing
terms. 

I definitely need it to work so that its output comes fine 
via the pipe and that I can give commands to it via the pipe.
I looked at the code and is something I wouldn't like to
tweek :-) any ideas when this is going to be 'improved' ?

It would be nice if it could also work via socket :-) would
work on that if I had the time...

                cheers,
                         Emilio



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

Date: Mon, 05 May 1997 10:46:39 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Perl or 'C'????
Message-Id: <fl_aggie-ya02408000R0505971046390001@news.fsu.edu>

In article <5kjmdu$74k@in2.doitnow.com>, toeknee@doitnow.com (Simba) wrote:

+ I need to start writing CGI scripts. I already have 'C' experience. Is
+ it worth it to learn Perl??? Or just stick with 'C'?

Perl is worth knowning. That said, however, if you know C and you need
something *soon*, then use C.

James - well, as long as you use a C CGI library to do the munging of the
        input data... ;)

-- 
Consulting Minister for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 05 May 1997 18:40:39 GMT
From: ceh@suntan.sce.carleton.ca (Curtis Hrischuk)
Subject: potential bug in Perl 5.003 garbage collection
Message-Id: <CEH.97May5144039@suntan.sce.carleton.ca>


Hi.  I believe I have found a bug in either the perl garbage
collection routine or a semantic problem with references.  Here is a
reduced version of the code I am executing. 

sub problem_setup
{
 my $self = shift;

 {
   my $localObject= new anObject(key => 1);
   ${self->{aHash}}{1} = \$localObject
 } 

 $self->problem(${self->{aHash}}{1});
}


sub problem 
{
  my $self = shift;
  my($anObjectRef) = @_;
  my($key) = $$anObjectRef->key();

  if (defined ${self->{aHash}}{$key}) {
    ${self->{aHash}}{$key} = undef;       # this is initially set to a reference to the same object as anObjectRef
    delete ${self->{aHash}};
    $$anObjectRef->destroy();     # <---  Perl craps out here
  } 
}

In the method "problem", why doesn't "$anObjectRef" keep the
$localObject object around?  Is the reference counting working
properly?  

Thanks for your time.

Curtis
-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Curtis Hrischuk (PhD Cand)  "in reality that comes from above      _/
_/ ceh@sce.carleton.ca          God is calling                        _/
_/ Carleton University          there's no bigger love                _/
_/ Ottawa, On., Canada, K1S-5B6 It's his reality that welcomes us back_/
_/ Ph  (613) 520-2600 x1762     Trust and obey                        _/
_/ FAX (613) 520-5727           there is no other way..." the newsboys_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


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

Date: Mon, 05 May 1997 18:19:55 -0500
From: Gaylon Stockman <stockman@rdbewss.redstone.army.mil>
Subject: Reading data from a file and outputting to another file
Message-Id: <336E6B1B.167E@rdbewss.redstone.army.mil>

Disclamier - I am trying to learn Perl.

 I have the Camel and LLama books - been there, done that on trying
to extract from the examples.

 I am trying to write a Perl script to extract data from an input
file and output the required info to another file. I have had
some success to date - but not much. Could someone lend a hand ??
Possibly provide a small example ??

 Here is what I have.
 I have a input file that follows a loosely formatted structure.
I should be able to key off some of the "descriptions" that are
on the same line as the data. I would like to extract certain
records and output those records as one line in a output file.

 The input file structure is as follows:
records not needed
START_VEHICLE_PARAMS is the start of the data
next 3 lines need to extract data or key off of the descriptions
  on the right hand side. This way if the format changed the
  descriptions would remain the same (??)
search for ENUMERATION TYPE and get data at the front of that record
output extracted info to a file
start over by looking for START_VEHICLE_PARAMS again and get data
  until end of file is reached

 I can write this in a higher level language w/o a problem, but I
believe this should be something that is very easily well suited for
Perl. Maybe I am making it more difficult than it really is.

 Below is a sample input file and sample output file of what I am
looking for. Can someone provide an example of something that will
do this or something along the same lines ?? I probably am just
missing something on syntax.

** Input File **

 .
 .
 .
!---------  START_VEHICLE_PARAMS   --------
  1                            'TYPE INDEX'
  'BIG_CAR'                     'VEHICLE DESCRIPTION'
  'CADDY'                       'VEHICLE CLASS DESCRIPTION'
  'BOSE_RADIO'                  'COMM DEVICE DESCRIPTION'
  1                             'NUMBER OF RADIOS ON VEHICLE'
  'BRIGHT_BEAM'                 'HEADLIGHT TYPE(S) ON VEHICLE'
 .
 .
 .
    F,T,F                       'YES,NO,MAYBE'
    1 1 222 1 1 0 0             'ENUMERATION TYPE'
 .
 .
 .
  F,T,T                         'YES,NO,MAYBE'

  ------   START_VEHICLE_PARAMS   --------
  2                             'TYPE INDEX'


** output file **
Number   Index   Descrption      Class      Enumeration
1        1       'BIG_CAR'       'CADDY'    1 1 222 1 1 0 0
2        2       'BIG_TRUCK'     'F150'     1 2 225 3 1 4 0


  Any help or pointers are greatly appreciated.


-- 

Gaylon Stockman

stockman@rdbewss.redstone.army.mil


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

Date: 5 May 1997 23:08:46 GMT
From: tommy@best.com (Tom Vaughan)
Subject: Re: scalar holds compiled code
Message-Id: <5klp9u$qe2$1@nntp1.ba.best.com>


Abigail (abigail@fnx.com) wrote:
: Look up in the manual or the Camel:
:    system, qx, backticks and exec.

Unfortunately no. The functions you've mentioned involve file access.
In my case, $STUFF already holds the contents of what could be considered a
file. What I need is a way to execute not a file but a location in memory.

--
Tom Vaughan <tommy@best.com>


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

Date: 5 May 1997 20:43:46 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Script runs fine from shell, but browser doesn't receive variables
Message-Id: <slrn5mshk2.9b.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	myxx@sel-mor.com wrote:
[cgi script]
>From the shell it works great, but from the browser I get not out put.

Did you read the FAQs? What uid does the httpd run under? Did you check
whether the executable file has the right permissions to be executed by
that uid?

<sigh>

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: Tue, 06 May 1997 07:48:49 +0900
From: christopher <mrchristopher@inorbit.com>
Subject: Singles and doubles
Message-Id: <336E63D1.528C@inorbit.com>

Hi Hi

Thanks once again to all the people who helped with my last question.  I
have returned once again with another one that I know is in the
documentation but I can't figure it out (rather, make it work).

How can I define a string that contains stuff to be evaluated so that it
isn't evaluated the first time it's defined but rather when it's used
inside double quotes..

So if anyone can tell me how to make this idea work..

$stuff='$this+$that';
$that=5;
while <FILE> {
$this++;
$theanswer="10+$stuff";
}

It's a quote thing I guess.. 

Thanks people once again.

Christopher
Tokyo,May97

http://www.wonderlandinorbit.com


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

Date: Mon, 05 May 1997 20:41:52 GMT
From: mdickson@cyberus.ca (Mike)
Subject: system commands and CGI woes
Message-Id: <336e437e.97072109@news.alt.net>

Hi

I have looked through the version 3 FAQ, and other sources on the net,
and I can't seem to find the answer to my problem.

How can I ensure that a directory is writable by the EUID?  I need to
ensure that a given path is writable for the `touch` command in my CGI
script before I try and use it.

Conversly, if you can capture the return from the touch command (ie,
prevent its writing to STDOUT or STDERR), I could to the write and the
test on one line.

Thanks for the help.

 ...Mike


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

Date: Mon, 5 May 1997 19:55:39 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Urgent help needed!  State abbreviation conversion
Message-Id: <tcyangE9q4os.C1A@netcom.com>

People have shown you the URL containing such documents.  It is your
exercise now to write a Perl script to extract the information from
the specified formats into a Perl program you can use.

(If you do not want to type in all the 50 states, neither do us, so
after you are done, don't forget to post here so others do not need to
do it again :) )

========================================
Tim Simms (tsimms@intr.net) wrote:
: Hi! 

: I apologize for only coming to the list when I need something, but could
: someone please point me to some source of State name conversion to the
: state 2 letter abbreviation?  It doesn't matter which way, but it would be
: best to go both ways.  All I really need is a list of the 50 states and
: their abbreviations, and I'll make an associative array, but the point is
: I don't know the abbreviations and I don't want to have to type in the
: whole 50 states!  Perhaps someone has already done this or knows where
: such a list exists?

: Thanks much!

: Regards,
: -Tim

: And if someone does help, I'll promise to start reading this list
: semi-regularly and helping others!

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 436
*************************************

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