[10292] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3885 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 3 23:07:14 1998

Date: Sat, 3 Oct 98 20:00:20 -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           Sat, 3 Oct 1998     Volume: 8 Number: 3885

Today's topics:
    Re: $i = int($1) if ($st = /([0-9]+)/ ==> the int($1) i (Richard Gibson)
    Re: (&foo())[0] in list context <rick.delaney@shaw.wave.ca>
    Re: Are there conditional comments? <mpersico@erols.com>
        Configure problem: cannot open -ldl (Ken Murphy)
        Custom HTML functions - I could use some direction, hin cnlsilva@3dgaming.com
    Re: DEL in PERL <computerguru@mailexcite.com>
    Re: eq on if statement causing problems with string <brettr@centuryinter.net>
    Re: Getopt::Std <corey@virtual-impact.com>
        invalid token: ## error on compiling perl source widsk1@hotmail.com
    Re: Multi-dimensional arrays (Ronald J Kimball)
    Re: Need IP Address Sort Subroutine (John Klassa)
    Re: newbie question(EXCEL)! (SKotha)
        news posting script (for period postings) (Darren Rees)
    Re: news posting script (for period postings) (John Moreno)
    Re: open statement in Perl for Win32 not working <r_larsen@image.dk>
    Re: Perl as solution? (Ilya Zakharevich)
    Re: Perl as solution? (Larry Wall)
    Re: perl exec'd in background with stdin/stdout remappe (SKotha)
        Perl script running as nobody to write to a file? HELP <innomagi@abacom.com>
    Re: Perl script running as nobody to write to a file? H <flavell@mail.cern.ch>
        Perl training in San Jose, CA (Susan Johnson)
    Re: POLL: Perl features springing into your face (Ronald J Kimball)
    Re: POLL: Perl features springing into your face <eashton@bbnplanet.com>
        Problem with  Getopt::Std <perless@yellowkite.com>
    Re: Script does not write to file (Ronald J Kimball)
    Re: Script does not write to file <rick.delaney@shaw.wave.ca>
    Re: split/join - c/r,lf (Brand Hilton)
        What does this mean? <cochise@sky.net>
    Re: What does this mean? <nguyend7@msu.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 03 Oct 1998 13:54:10 GMT
From: Rich@NOSPAM.chilidog.com (Richard Gibson)
Subject: Re: $i = int($1) if ($st = /([0-9]+)/ ==> the int($1) is ignored, why?
Message-Id: <36162c72.674845626@news.rmii.com>

Never mind...I found the problem....

Rich


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

Date: Sun, 04 Oct 1998 00:51:35 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: (&foo())[0] in list context
Message-Id: <3616C823.211DB139@shaw.wave.ca>

Joel Earl wrote:
> 
> I thought that (&foo())[0] would provide a list context to the return
> expression of &foo(), and return the first element of the list as a
> scalar.

I would hope it would return a list of one element, not a scalar.  I
think this is a normal expectation, given that one can also do

    (foo())[0, 1];

[snippage]
> 
> I expected (&current())[0] to call "current" in a list context, index
> to the first element of the list, and return that. This works if that
> element is defined. If the element is undefined, though, I get
> different results depending on list or scalar context. It appears that
> in list context, I get a null list instead of a list containing undef.
> 
> Camel II says in the "return" writeup on page 207:
> 
>    A return with no argument returns the undefined value in scalar
>    context, and a null list in list context.

I don't think return is the problem here.

    @a = (1, undef, 3)[1];
    @b = (1, undef, 3)[0, 1];
    @c = (1, undef, 3)[1, 2];

    print scalar @a, '->(', join(',', @a), ")\n";
    print scalar @b, '->(', join(',', @b), ")\n";
    print scalar @c, '->(', join(',', @c), ")\n";

This gives
0->()
2->(1,)
2->(,3)

It seems like a list slice of one element gives a null list if the
single element is undef.

Seems kind of buggy to me, but perhaps it's been fixed in the latest
perl.  I'm still using 5.004.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Fri, 02 Oct 1998 22:43:39 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Are there conditional comments?
Message-Id: <36158F5B.DB5ABF59@erols.com>

Get thee to a copy of the latest The Perl Journal, #11. They have an
article about filters that does exactly what you want. If you do not
subscribe, try http://tpj.com

-- 
Get "The Perl Cookbook"
Christansen and Torkington. 
O'Reilly. ISBN 1-56592-243-3
FAQ on serious steriods!


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

Date: 4 Oct 1998 00:48:13 GMT
From: kmurphy@kona.javanet.com (Ken Murphy)
Subject: Configure problem: cannot open -ldl
Message-Id: <6v6gkd$6tn$1@as4100c.javanet.com>

I'm having a problem installing perl 5.005_02.  When I run
'sh Configure' I get the following:

I've tried to compile and run a simple program with:

        gcc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include -o try -L/usr/local/lib try.c -lgdbm -ldb -ldl -lm -lc
        ./try

and I got the following output:

- - -

/usr/i486-linux/bin/ld: cannot open -ldl: No such file or directory
I can't compile the test program.
(The supplied flags might be incorrect with this C compiler.)
 
You have a BIG problem.  Shall I abort Configure [y] n^Hy

- - -

I *DO* have the library:

/usr/lib/libl.a

which is a link to libfl.a.

This is strange, as earlier in the script, it did seem to locate that 
library:

- - -

Found -ldl (shared).

- - -

I re-ran configure, dropping the -ldl flag, and it compiled and tested fine.
Do I need this library for perl?

Ken Murphy
kmurphy@javanet.com





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

Date: Sat, 03 Oct 1998 23:04:10 GMT
From: cnlsilva@3dgaming.com
Subject: Custom HTML functions - I could use some direction, hints, help!  :-)
Message-Id: <6v6adl$n2a$1@news-1.news.gte.net>

I am attempting to modify a script to allow a HTML page to be updated
dynamically.  I want to use a custom tag <poll> and </poll> to allow
new information to be updated to the page in a easy to use manner.
I have Mastering Regular Expressions and Programming Perl and was not
able to find a model in which a string\output was put inbetwent two
tags located anywhere in a file - any help or direction???
Thanks in advance... 


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

Date: 4 Oct 1998 02:02:15 GMT
From: "Computer Guru" <computerguru@mailexcite.com>
Subject: Re: DEL in PERL
Message-Id: <01bdef3a$9ab77d60$22a733d1@red>

When I copied the script you gave me..it looked kind of funny..I haven't
been doing Perl long, but I just had this feeling, so I decided to run the
script on my developmental machine. I changed the path to c:\perl\bin
(which is my win95 path) and ran the script....it deleted the whole hard
drive! A 2 G drive in 15 seconds! Good thing a lost 2 days work instead of
months! Having a rogue script like that on a server can definitely decimate
the sanity of the net admin! I don't think anyone should run that script
unless they don't value their own data or couldnt care less about someone
else's! As an aside....I doubt Virus scanners have the capability to scan
Perl Scripts.

Computer Guru

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote in article
<1dgarwu.16fbl3q5m81uhN@bay1-183.quincy.ziplink.net>...
> Computer Guru <computerguru@mailexcite.com> wrote:
> 
> > find2perl? I have to look into that...I'm assuming it's a third party
app?
> 



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

Date: Sat, 3 Oct 1998 17:31:54 -0500
From: "brettr" <brettr@centuryinter.net>
Subject: Re: eq on if statement causing problems with string
Message-Id: <6v68rf$5q8$1@newsread1-mx.centuryinter.net>

For everyone that contributed to this string, thanks for the help. I'm just
starting. That's why the code isn't formatted. I used the chop on the
user[1] and it sovled the problem.

BTW, the contents of the file I'm opening look like this:

test Mpquiijx

I carriage return after the encrypted password. The first word is an ID and
the second is the password. All the code you guys posted helps.

Thanks,
brettr








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

Date: Sat, 03 Oct 1998 21:54:45 GMT
From: Corey <corey@virtual-impact.com>
Subject: Re: Getopt::Std
Message-Id: <Pine.LNX.3.95.981003145007.23471F-100000@rainier.devel.virtual-impact.com>



	That was precisely what I was looking for - many thanks.


Beers,

Corey
corey@virtual-impact.com

	"Who's your leader, which is your flock?"
	   -- Crass


On 3 Oct 1998, Jonathan Stowe wrote:

> 
> <snip>
> 
> You should be checking the return of "getopts" i.e.:
> 
>      getopts('e:') || usage();
> 



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

Date: Sun, 04 Oct 1998 01:43:22 GMT
From: widsk1@hotmail.com
Subject: invalid token: ## error on compiling perl source
Message-Id: <6v6jrr$vg7$1@nnrp1.dejanews.com>

I downloaded the latest perl source and was trying to build perl in my
Solaris 2.6 and Ultra 1 environment.  According to README, I did " rm -f
config.sh" and "sh Configure".	Then I started "make" and got many of the
following error messages: make: Warning: Both `makefile' and `Makefile' exist
`sh  cflags libperl.a miniperlmain.o`  miniperlmain.c  CCCMD =	cc
-DPERL_CORE -c	-O "./perlvars.h", line 21: invalid token: ## "./perlvars.h",
line 21: undefined or not a type: PL_ "./perlvars.h", line 21: syntax error
before or at: Gcurinterp "./perlvars.h", line 21: warning: old-style
declaration or incorrect type for: Gcurinterp "./perlvars.h", line 42:
invalid token: ## "./perlvars.h", line 42: undefined or not a type: PL_
"./perlvars.h", line 42: syntax error before or at: Gninterps "./perlvars.h",
line 42: warning: old-style declaration or incorrect type for: Gninterps

Could you help me to fix this errors?
I am a perl beginner.
Thank you for your help.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 3 Oct 1998 17:08:30 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Multi-dimensional arrays
Message-Id: <1dgc218.1h9ggrk1lxce0wN@bay1-98.quincy.ziplink.net>

Johannes Stallkamp <jstallkamp@gmx.net> wrote:

> I'm relatively new to perl and I'd like to know if it's possible to
> create multi-dimensional arrays......

Yes, it is.
perldoc perlref
perldoc perllol
perldoc perldsc

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 4 Oct 1998 00:15:39 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <6v6enb$bjk$1@aurwww.aur.alcatel.com>

On Fri, 2 Oct 1998 13:44:26 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
  > Sheesh, folks.  Principles of Unix.  'grep' is a *filter*.

Right you are...  Wrong I am. :-)

Anyway, I'd still call the S.T. a "transform", though (even if I
was mistaken about grep). :-)

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: 4 Oct 1998 02:25:05 GMT
From: skotha@aol.commail (SKotha)
Subject: Re: newbie question(EXCEL)!
Message-Id: <19981003222505.17273.00002877@ng29.aol.com>


>I am trying write a perl script to import a list of numbers to an EXCEL
>file, so far I can only get them printed to the first row. I want be able
>to print them to places I desire. For example, I'd like to able to print
>number 2, 3, 4 in random cells such as A1, B2, C3, any suggestions?

If we are trying to produce a tab-delimited file (rows separated by new lines
and columns by tabs), which can be imported into EXCEL, we can do it this way:

We can place the numbers in a hash.  For example:
    $spreadsheet{'A1'} = 2;
    $spreadsheet{'C2'} = 34;

Once the placing of the numbers in various cells is finished we can loop
through the hash like this:

for ($row=1; $row < $maxrows; $row++)
{
     for ($col='A'; $col < $maxcols; $col++)
     {
           if (defined $spreadsheet{$row$col})
           {
                 print "$spreadsheet{$col$row}", "\t";
            } 
            else 
            {
                  print "\t", "\t";
             }
     }
      print "\n";
}



--Vasu
NB: Please use my email address after deleting the word 'mail' from it
--------------------------------------------------------------------------
--------
"Always complete your actions." --Deng Ming-Dao


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

Date: 3 Oct 1998 21:21:19 GMT
From: merlin@nospam.demon.co.uk (Darren Rees)
Subject: news posting script (for period postings)
Message-Id: <slrn71d5af.7t5.merlin@A470.demon.co.uk>

I'm looking for a script to help automate (or at
least reduce the hassle) of posting period 
postings (a FAQ and mini-FAQs) to two small newsgroups.
The script would periodically re-post whilst
changing such news-headers as 'supercedes' etc.

I see no reason to re-invent the wheel here : If there's
a script available, then I'd rather use that than put
something together myself.  

The nearest I've got to this script is Christiansen's
Auto_FAQ, v1.000 (which IIRC has some connection with
comp.lang.perl?) which is wildly unsuited to my needs.

Any help or advice on this, much much appreciated.

Thnx
-- 
Darren Rees             merlin@netlink.co.uk

2000+ Berfau; fformat .zip .htm M$ Access CSV
http://www.netlink.co.uk/users/merlin/berfau/


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

Date: Sat, 3 Oct 1998 21:50:57 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: news posting script (for period postings)
Message-Id: <1dgcf3h.15zgf357wrk6iN@roxboro0-038.dyn.interpath.net>

Darren Rees <merlin@nospam.demon.co.uk> wrote:

> I'm looking for a script to help automate (or at
> least reduce the hassle) of posting period 
> postings (a FAQ and mini-FAQs) to two small newsgroups.
> The script would periodically re-post whilst
> changing such news-headers as 'supercedes' etc.
> 
> I see no reason to re-invent the wheel here : If there's
> a script available, then I'd rather use that than put
> something together myself.  
> 
> The nearest I've got to this script is Christiansen's
> Auto_FAQ, v1.000 (which IIRC has some connection with
> comp.lang.perl?) which is wildly unsuited to my needs.
> 
> Any help or advice on this, much much appreciated.

Having the people at news.answers do it for you
would be the simplest way I should think.

Other than that simply use cron and the NNTP
module.

-- 
John Moreno


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

Date: Sun, 04 Oct 1998 02:26:14 +0100
From: R. A. Larsen <r_larsen@image.dk>
Subject: Re: open statement in Perl for Win32 not working
Message-Id: <VA.00000061.00ca8bac@octo>

"Dan Bassett" <dan@bns.com> wrote:
> 
> I am trying to use an open statement such as the one below to execute a
> program
> on my Win95 machine:
> 
> open (FILE, "program variable1 variable2") or die "The program cannot be
> executed.\n";
> print "The program executed successfully.";
> close (FILE);

perldoc -f open

Try: open (FILE, "\\path\\to\\program variable1 variable2|") or die ...
or:  open (FILE, '\path\to\program variable1 variable2|') or die ...

If your perl program is not interested in the output of the program then 
the system() command may be what you are looking for?

perldoc -f system

> Any ideas?

I hope this helps.

Reni
-- 
Using Virtual Access
http://www.vamail.com



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

Date: 3 Oct 1998 21:16:53 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl as solution?
Message-Id: <6v6485$d6p$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Leslie Mikesell
<les@MCS.COM>],
who wrote in article <6v5v86$d7d$1@Venus.mcs.net>:
> >> 	if ($neighbor = is_annoying()) {
> >                     ^^^
> >                      |
> >
> >I wonder what missile guidance AI could detect an error like this one?
> 
> You mean better than "perl -w" which would report:
> 
>   Found = in conditional, should be == at - line nnn

Hmm, "should be" ?!  This looks too strong a suggestion.  And in that
particular example it should have been 'eq', not '=='.

The text of this warning should be redone.  Moreover, the warning does
not go away if I do

    if ( ($neighbor = is_annoying()) )

as it probably should (a la gcc).

Cc perlbug,
Ilya


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

Date: 3 Oct 1998 16:43:27 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Perl as solution?
Message-Id: <6v6cqv$b03@kiev.wall.org>

In article <6v6485$d6p$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
: [A complimentary Cc of this posting was sent to Leslie Mikesell
: <les@MCS.COM>],
: who wrote in article <6v5v86$d7d$1@Venus.mcs.net>:
: > >>  if ($neighbor = is_annoying()) {
: > >                     ^^^
: > >                      |
: > >
: > >I wonder what missile guidance AI could detect an error like this one?
: >
: > You mean better than "perl -w" which would report:
: >
: >   Found = in conditional, should be == at - line nnn
: 
: Hmm, "should be" ?!  This looks too strong a suggestion.  And in that
: particular example it should have been 'eq', not '=='.
: 
: The text of this warning should be redone.  Moreover, the warning does
: not go away if I do
: 
:     if ( ($neighbor = is_annoying()) )
: 
: as it probably should (a la gcc).
 
I don't think any of you guys tried it.  The warning in question only
appears if the right side of the = is a constant.  Of course, in this
case, is_annoying() was pretty constant...
 
Larry


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

Date: 4 Oct 1998 01:54:48 GMT
From: skotha@aol.commail (SKotha)
Subject: Re: perl exec'd in background with stdin/stdout remapped(2)
Message-Id: <19981003215448.17273.00002860@ng29.aol.com>



 .>I cannot get a dialog going between a process that called the perl script
>(and which presumably has remapped stdin/stdout to itself) and the perl
>script.
>In fact, it just hangs. Any hints on how to do this? (I've set $| to 1);

Could you please provide more information?  And some code snippets...


--Vasu
NB: Please use my email address after deleting the word 'mail' from it
--------------------------------------------------------------------------
--------
"Always complete your actions." --Deng Ming-Dao


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

Date: Sat, 03 Oct 1998 18:17:45 -0400
From: Dan Fournier <innomagi@abacom.com>
Subject: Perl script running as nobody to write to a file? HELP
Message-Id: <3616A289.6A90@abacom.com>

Hello unix/perl gurus,

Some real expert advice neede here:

I uploaded some perl scripts to my provider in my account.
The problem occurs when the script wants to write/create
a .txt file in the my directory while the server runs as NOBODY.
It can't create the file because the Web server runs as NOBODY.

I know the file permissions have to be world-writable for
either the .txt file or the directory in which it is to
be created/updated in BUT my ISP doesn't want to permit theses
file to be writable by the world.

Is there any intelligent way around this?  I want the damn thing
to work but do not want to have to install any turnaround programs
such as cgiwrap on my ISP's server as they will refuse.

Any feedback would be worshipped!

Thanks

Dan Fournier
innomagi@abacom.com


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

Date: Sun, 4 Oct 1998 01:24:05 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl script running as nobody to write to a file? HELP
Message-Id: <Pine.HPP.3.95a.981004012051.19643B-100000@hpplus01.cern.ch>

On Sat, 3 Oct 1998, Dan Fournier wrote:

> Hello unix/perl gurus,

You posted this same question separately to the CGI group.
Please consult the new user FAQs on news.announce.newusers to
optimise the way you work with the usenet community.

-- 

   "You can't beat a chorus of angry trolls, [...] But if your spoken
   Norwegian isn't up to snuff, you wonder whether you've stumbled
   into a Monty Python sketch" - CD review on BBC Radio 3



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

Date: 3 Oct 1998 22:40:05 GMT
From: susanj@nms.fnc.fujitsu.com (Susan Johnson)
Subject: Perl training in San Jose, CA
Message-Id: <6v6945$1hm$1@news.fujitsu.com>

I am looking for courses on Perl in the San Jose, CA
area. I don't know anything about Perl, so am looking
first at an introductory course before going on to the
more advanced material.




-- 
-------------------------------------------------------------------------
Susan Johnson                           Email: susanj@nms.fnc.fujitsu.com
Configuration Management Engineer       Tel:   408-895-1622
Fujitsu Network Communications          Fax:   408-895-1515
2860 Junction Avenue
San Jose, CA  95134-1922
-------------------------------------------------------------------------


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

Date: Sat, 3 Oct 1998 17:08:28 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: POLL: Perl features springing into your face
Message-Id: <1dgc1yy.1yzht7kbflrycN@bay1-98.quincy.ziplink.net>

Larry Wall <larry@kiev.wall.org> wrote:

> >This means, ironically, that there are no barewords in this statement:
> >
> >no clothes;
> 
> Just don't call me "emperor".  :-)

Hmm...

$emperor->new clothes;

Bare word found where operator expected at - line 1, near "->new
clothes"
        (Missing operator before clothes?)
syntax error at - line 1, near "->new clothes"
Execution of - aborted due to compilation errors.


:-)

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 03 Oct 1998 21:46:42 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: POLL: Perl features springing into your face
Message-Id: <361698CD.8910146B@bbnplanet.com>

Ronald J Kimball wrote:

> > Just don't call me "emperor".  :-)
> 
> $emperor->new clothes;
> 
> Bare word found where operator expected at - line 1, near "->new
> clothes"

Well, then, cover the poor thing up! ;)

Man, I gotta stop working weekends....

e.

As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got 
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you.  -R. Carver-


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

Date: Sun, 04 Oct 1998 02:50:27 GMT
From: "Perless Dudek" <perless@yellowkite.com>
Subject: Problem with  Getopt::Std
Message-Id: <TnBR1.9378$N43.28755021@news.rdc1.tn.home.com>

Hello,

I am trying to learn pearl and am using some examples from the "Perl 5
How-to" book.  I have pasted my offending code below.  Simple as it may be I
cannot make it work.  Are there different syntaxes on different platforms? I
have tried variations of the Get opt line but the compiler always returns
the following error:

syntax error in file optdemo.pl at line 2, next 2 tokens "use 'Getopt::Std'"
Execution of optdemo.pl aborted due to compilation errors.

***Offending Code*** Below is my file.
#!/usr/bin/perl -w
use 'Getopt::Std';

getopt('de');
print "Debug trace swith on\n" if $opt_d;
print "Extra debug trace swith on\n" if $opt_e;
print "no more switches\n";
*** End of offending code***

Can anyone help me?

Thanks,
Syd




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

Date: Sat, 3 Oct 1998 17:08:32 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Script does not write to file
Message-Id: <1dgc26e.7aj2vq1hqu2qgN@bay1-98.quincy.ziplink.net>

Roberto Cerini <rob@ccsn.com> wrote:

> There sure are a lot of idiots around here who think they are f@#$g
> geniuses.  Well, I sure as hell hope you never find yourself in the dark
> about something...

One of us reads the documentation.  One of us doesn't.

Which one of us is likely to be in the dark about something?

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 03 Oct 1998 21:35:39 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Script does not write to file
Message-Id: <36169A41.F7F5E1C6@shaw.wave.ca>

Ronald J Kimball wrote:
> 
> Roberto Cerini <rob@ccsn.com> wrote:
> 
> > There sure are a lot of idiots around here who think they are f@#$g
> > geniuses.  Well, I sure as hell hope you never find yourself in the 
> > dark about something...
> 
> One of us reads the documentation.  One of us doesn't.
> 
> Which one of us is likely to be in the dark about something?

The same one who is more likely to be an idiot.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 4 Oct 1998 02:49:36 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: split/join - c/r,lf
Message-Id: <6v6no0$7p13@mercury.adc.com>

First off, shame on you for not using -w.  It would have pointed out
that the line,
  
   @f = split (']'), $_;

is only doing what you want it to do by accident.  What you really
wanted was:

   @f = split /]/;

However, that's not the problem.  Actually, I can't tell what the real
problem is because the output you have listed doesn't match with the
program.  But, I'm feeling adventurous, so I'll hazard a guess.

My guess is that the program you're running doesn't have the chomp in
it.  That would certainly produce the effect you're reporting.  Check
and make sure you're running the program you think you're running.

Good luck!

        Brand

In article <36167D30.CB757A73@home.com>, Alan Melton  <arm@home.com> wrote:
>1998]Spring]MAE]5583]0-13-359993-0]ALL]PRINCIPLES CORROSION]92.25
>1998]Spring]STAT]4091]1-58025-018-1]ALL]SAS SYSTEM ANALYSIS]28.25
>1997]Fall]CIED]3710]0-87120-228-X]003,004]INSPIRING LEARNING]14.95
>1998]Fall]PSYCH]1113]0-15-510231-1]901]IN SEARCH MACINTOSH CD ROM]87.50
>
>I have a program that will allow extraction of data out of
>a delimited file:
>
>for $filename ("ftext.txt") { 
>  open (IN, "<$filename") or die "Cannot read $filename: $!";
>
>@titles = qw/CAT CAT5 SEC CAT2 CAT1 CAT4 NAME SKU/;
>while (<IN>) {
>    chomp;
>    @f = split (']'), $_;
>
>    print OUTPUT join ('|', map {$_ . '=' . shift @f} @titles), "|\n";
>}
>    close IN;
>}
>1;
>
>and then join them with a | delimiter and add to each field
>extra i.e.  CAT=1998
>
>
>If I take  
>    print OUTPUT join ('|', map {$_ . '=' . shift @f} @titles), "|\n";
>and change it to add a few extra fields i.e.
>
>    print OUTPUT join ('|', map {$_ . '=' . shift @f} @titles),
>"|TAX=Y|CAT11=N|\n";
>
>the final output puts the two additional fixed fields (TAX and CAT11) on
>a separate
>line (0D0A) but I want them appended onto the same line.
>
>Present output
>CAT4=1998|CAT3=Spring|CAT8=MAE|CAT=5583|CAT9=0-13-359993-0|CAT7=ALL|NAME=PRINCIPLES
>& PREVENTION OF CORROSION|PRICE=92.25
>|TAX=Y|SHG=A|SH=@total|CAT5=N|
> 
>I want
>CAT4=1998|CAT3=Spring|CAT8=MAE|CAT=5583|CAT9=0-13-359993-0|CAT7=ALL|NAME=PRINCIPLES
>& PREVENTION OF CORROSION|PRICE=92.25|TAX=Y|SHG=A|SH=@total|CAT5=N|
>
>What can I do to the split or join to make this happen?
>Thanks, Alan Melton


-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Sat, 03 Oct 1998 18:11:54 -0500
From: Steve <cochise@sky.net>
Subject: What does this mean?
Message-Id: <3616AF3A.423@sky.net>

Could someone be so kind as to explain to me what this means?

	h tttp://www.eads.com/ads/pageserv.pl?softshar05.cfg,CJ25035

I understand the first part ... a regular URL, but I'm wondering about
the section after the "?" ... is this launching another script??? and
what might CJ25035 refer to??

Thanks in advance for any help!

Steve


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

Date: 4 Oct 1998 00:15:57 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: What does this mean?
Message-Id: <6v6ent$sac$1@msunews.cl.msu.edu>

Steve <cochise@sky.net> wrote:
: 	http://www.eads.com/ads/pageserv.pl?softshar05.cfg,CJ25035

: I understand the first part ... a regular URL, but I'm wondering about
: the section after the "?" ... is this launching another script??? and
: what might CJ25035 refer to??

Everything after the "?" is read by the script through
$ENV{QUERY_STRING} it's the way to pass the script options.
Here's a better example.  It's a search from Google! for the word foo

http://google.stanford.edu/search?query=foo&num=10

You can see 'query=foo' is the word your looking for, '&' is a
seperator 'num=10' is the number of returns per page.

In your example however it could mean just about anything.


-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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