[12872] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 282 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 28 11:17:22 1999

Date: Wed, 28 Jul 1999 08: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           Wed, 28 Jul 1999     Volume: 9 Number: 282

Today's topics:
    Re: a bit of a bind.. (Bart Lateur)
        ASCII to ANSI conversion -- HELP jeff.fritsche@persoft.com
        Beginner needs help with a function <akelingos@petrosys-usa.com>
    Re: Beginner-friendly group as cultural adaptation? (Anno Siegel)
    Re: Beginner-friendly group as cultural adaptation? (Anno Siegel)
    Re: Beginner-friendly group as cultural adaptation? <gt7202e@prism.gatech.edu>
    Re: beginner-redirect and download <gellyfish@gellyfish.com>
        Creating dynamic GIF-s from CGI-script <pip@extech.msk.su>
    Re: Creating dynamic GIF-s from CGI-script (brian d foy)
        DBI help (Flint Slacker)
    Re: Directory Listing with Size (elephant)
    Re: ebcdic packed numbers (Bart Lateur)
    Re: ebcdic packed numbers <flavell@mail.cern.ch>
    Re: ebcdic packed numbers (Bart Lateur)
    Re: Getting Height and Width of GIF/JPEG in PERL? (I R A Darth Aggie)
    Re: Getting Height and Width of GIF/JPEG in PERL? (Walter Pienciak)
    Re: Getting Height and Width of GIF/JPEG in PERL? (Sean McAfee)
    Re: Help or possibly stupid syntax suggestion re: forea <sariq@texas.net>
    Re: How to: run a DOS batch in perl/cgi? <llornkcor@llornkcor.com>
    Re: How to: run a DOS batch in perl/cgi? (Bart Lateur)
    Re: Korn Shell or Perl? (Anno Siegel)
    Re: negated compiled regexp <ltl@rgsun5.viasystems.com>
    Re: negated compiled regexp <ltl@rgsun5.viasystems.com>
    Re: Newbie Q: Replacing a string by an array (Eugene van der Pijll)
    Re: Newbie Q: Replacing a string by an array (elephant)
        Newbie sort and references question. (Rory C-L)
    Re: Orwant book status? (was Re: stopping email) (John Klassa)
    Re: Pass by value or pass by reference? (Abigail)
        perl port to windows CE ? <dtbaker@bus-prod.com>
        perl to excel <peter.herger@swisslife.ch>
    Re: perl to excel <chradil@acuitive.com>
    Re: perl to excel <anonymous@web.remarq.com>
        Premature end of script headers??? <nds@instrumental.com>
    Re: print problem (Tad McClellan)
    Re: reg expression (I R A Darth Aggie)
    Re: Standard Unix Compress (elephant)
    Re: Using perl with another language? (Anno Siegel)
    Re: Which group is appropriate? <jimrie@guideguide.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 28 Jul 1999 12:09:01 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: a bit of a bind..
Message-Id: <37a0ef94.19848027@news.skynet.be>

Tom Christiansen wrote:

>I'd be more apt to do something like this:
>
>    my $fh = do { local *FH };
>    open($fh, $filename) || die "can't open $filename: $!";

I thought this code was a bit suspect, and it turns out I was right.
Well, I get different results on 5.004 and 5.005, with this code:

	$fh = do { local *FH };
	open FH, ">file1" or die "Can't open file1: $!";
	open $fh, ">file2" or die "Can't open file2: $!";
	print FH "Print to file 1\n";
	print $fh "Print to file 2\n";

5.005 indeed considers $fh and FH as being different filehandles.

On 5.004, both files are created, but file1 is empty, and file2 gets
both lines of text. In other words: FH and $fh is ONE handle. 

How can this be? Because local() temporarily saves the contents of the
localized stuff on the stack, and then reinitializes it. At the end of
the block, the original value is restored. It turns out that on 5.004 ,
localized or not, it's still the *same typeglob*.

So the second open() statement closes the first file while it's still
empty, and opens the second file for both $fh and FH.

So there's your reason for the elaborate way it is done in the modules.
It looks like it's not longer necessary, from 5.005.

	Bart.


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

Date: Wed, 28 Jul 1999 14:51:48 GMT
From: jeff.fritsche@persoft.com
Subject: ASCII to ANSI conversion -- HELP
Message-Id: <7nn5e1$vu6$1@nnrp1.deja.com>

I need to create a script that converts ANSI characters to ASCII
characters.  I've looked high and low and can't find anything in
perlfaq or the newsgroups.  I've seen a mention about "OEMtoansi" but I
haven't been able to find it on CPAN or anywhere else.

Does anybody have any suggestions ???

Thanks.


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


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

Date: Wed, 28 Jul 1999 14:56:04 GMT
From: "Alec Kelingos" <akelingos@petrosys-usa.com>
Subject: Beginner needs help with a function
Message-Id: <01bed909$73961020$7637ebcf@psusa6.petrosys-usa.com>

I need a function to trim the first/last characters off a string if and
only if these characters are a user defined character.

e.g.   

I'm reading records from the following file:

|MICHIGAN|
|TEXAS|

Other files have other first/last characters

"MICHIGAN"
"TEXAS"

But other files may just be

MICHIGAN
TEXAS

Any way to write some function that takes the string and a character to
trim.  Something like

$newString = trimChr($string,"|")

and trim the string if inclosed by the specified character, otherwise leave
it alone?  Perhaps some niffty regular expression.

Thanks in advanced

Alec Kelingos



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

Date: 28 Jul 1999 14:02:53 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <7nn2id$b12$1@lublin.zrz.tu-berlin.de>

Daniel Grisinger  <dgris@perrin.dimensional.com> wrote in comp.lang.perl.misc:
>John Callender <jbc@shell2.la.best.com> writes:
>
><snip>
>
>Wouldn't it be easier to create a mailing list that we
>can redirect people to?

The typical newbie wants to run away with the answer to a single
question.  A mailing list is about as unsuitable as it gets.

Anno


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

Date: 28 Jul 1999 14:10:32 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <7nn30o$b1q$1@lublin.zrz.tu-berlin.de>

Clayton L. Scott  <tex@engsoc.carleton.ca> wrote in comp.lang.perl.misc:
>You, yes you, John. Stop writing crap like this:
>: much participation as something more neutral, like *.beginner or
>: *.amateur. And then there's just plain *.newbie.
>
>	How about c.l.p.answers? It could be a moderated newsgroup
> containing all of the FAQs and related docs to really reduce the noise.

How, exactly, would that work better than pointing them to the faq
on their own hard disk?

>	Anyone could be pointed to said group for reference and told to
> come back when their questions meet criteria in the article titled
> "How to phrase a question in c.l.p.misc" etc.

Every new user on clpm is mailed a well written piece on what and
how to post here.  Of course, that's exactly one posting too late.

Anno


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

Date: Wed, 28 Jul 1999 10:44:33 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <379F1751.DF91FC5D@prism.gatech.edu>

"Clayton L. Scott" wrote:

>         How about c.l.p.answers? It could be a moderated newsgroup
>  containing all of the FAQs and related docs to really reduce the noise.


Drop comp.lang.perl.misc and make
comp.lang.perl.manuals.are.useful
comp.lang.perl.manuals.are.scary


:)



-- 
 andy barfoot


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

Date: 28 Jul 1999 12:04:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: beginner-redirect and download
Message-Id: <379ee3ab@newsread3.dircon.co.uk>

llornkcor <llornkcor@llornkcor.com> wrote:
> 
>        I dont think it offtopic here, whats the 'misc' in the
> comp.lang.perl.misc mean?? I think your condescending answers
> (Abigail) are of poor taste, and more off topic than any question here. 
> 

No all this whingeing is off-topic here.  The original posters question
didnt even mention Perl, and even if he had done the answer would have
been the same whatever language we were talking about.  Do you really
think that we should answer  every question however distantly related
to Perl it might be - "How can I rewire my house ?  I need electricity
to power my computer in order to run a Perl program" - if you advocate
that we should answer questions about Browsers then you are advocating
that we should answers about electricity in my opinion.


/J\
-- 
"Some saw Noel Edmonds as a stinking slimy downmarket local rep from a
package holiday firm. His critics were less kind" - Victor Lewis-Smith,
TV Offal


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

Date: Wed, 28 Jul 1999 06:30:37 -0700
From: "Pip" <pip@extech.msk.su>
Subject: Creating dynamic GIF-s from CGI-script
Message-Id: <7nn0m4$bip$1@news1.relarn.ru>

Hi, ppl!
Question:
Is there any templates/simple examples how to creat GIF images
from (for example) CGI-script WITHOUT any modules?
I agree make it "pixel by pixel" :) Main goal: NO MODULES needed.

Thanks a lot.




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

Date: Wed, 28 Jul 1999 10:02:44 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Creating dynamic GIF-s from CGI-script
Message-Id: <brian-ya02408000R2807991002440001@news.panix.com>

In article <7nn0m4$bip$1@news1.relarn.ru>, "Pip" <pip@extech.msk.su> posted:

> Is there any templates/simple examples how to creat GIF images
> from (for example) CGI-script WITHOUT any modules?
> I agree make it "pixel by pixel" :) Main goal: NO MODULES needed.

creating a GIF is not a simple thing.  you could do it with no modules,
but your code is likely to be thousands of lines long.

just use a module.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Wed, 28 Jul 1999 17:23:07 GMT
From: flint@tcn.net (Flint Slacker)
Subject: DBI help
Message-Id: <37a13778.3132708@news.remarq.com>


I wrote a program that insert information into a mysql server using
DBI.  I was able to insert 23081 records and then I received an error:

DBI->connect failed: Can't connect to MySQL server on x.x.x.x (61) at
Name.pm line 96
connecting: Can't connect to MySQL server on x.x.x.x (61)
Can't call method "prepare" without a package or object reference at
Name.pm line 99, <FH> chunk 36.

Sometimes it finishes the entire batch to insert, sometimes not.  

Any idea of why this happens?


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

Date: Wed, 28 Jul 1999 23:10:51 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Directory Listing with Size
Message-Id: <MPG.1209ac658863f8f0989b9c@news-server>

Adrian Duncan writes ..
>I need to write an app in Perl that gets a list of directories
>from a parent directory.

<deletia>

>Can anyone suggest a routine that would work on NT please?

considering the vague specifications ('gets') .. this should be quite 
simple

#!perl -w
use strict;

my @x = `dir /s ..`;
__END__

HTH

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 28 Jul 1999 12:08:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ebcdic packed numbers
Message-Id: <379ee804.17911756@news.skynet.be>

Uri Guttman wrote:

>  BL> Anyway, in order to decode BCD data, you could first convert this data
>  BL> to a hex string, e.g. using sprintf(), and treat the result as a decimal
>  BL> number. Basically, that should cut it.
>
>this fails as they are decimal numbers, not hex. you have to grab each
>nibble (maybe with some unpack template) and do a *= 10, += digit loop
>on it. i did a pl/i any 2 any converter many years ago and know this
>stuff too well.

Are you sure it will fail? Suppose, as a simple example, that the upper
nibble is 1, the lower nibble is 2 (byte = 18). If you print it out as a
hexadecimal number, you get "12". What's would you want as the value for
the byte? 12.

Conversion to hex printout simply prints one digit per nibble. Digits
only, as hex digits "A" through "F" should never appear.

	Bart.


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

Date: Wed, 28 Jul 1999 14:37:22 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: ebcdic packed numbers
Message-Id: <Pine.HPP.3.95a.990728143119.21563F-100000@hpplus03.cern.ch>

On Wed, 28 Jul 1999, Bart Lateur wrote:

> Conversion to hex printout simply prints one digit per nibble.

Yup..

> Digits
> only, as hex digits "A" through "F" should never appear.

Not quite, because of the final nibble, which represents the sign (the
actual bit patterns used for + and - seem to have been a "bit" erratic,
but they were always in the A-F range, and the least significant bit is
what determines the sign).

Provided that you trim that off from the printed string, and
handle it specially, then otherwise you're right.

Incidentally this format is quite capable of representing minus zero ;-)




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

Date: Wed, 28 Jul 1999 13:25:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ebcdic packed numbers
Message-Id: <379f03f6.25064144@news.skynet.be>

Bart Lateur wrote:

>Conversion to hex printout simply prints one digit per nibble. Digits
>only, as hex digits "A" through "F" should never appear.

Now I've done a little experimenting, and actually, it turns out to be
incredibly simple. Difficult to understand, but little code. :-)

	$short = pack('C2',1*16+2,3*16+4);
	print unpack('H4',$short);
-->
	1234

That looks precisely like the result I wanted. It's a string, but in
Perl, that doesn't make much of a difference.

	Bart.


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

Date: 28 Jul 1999 13:23:15 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <slrn7pu168.gad.fl_aggie@thepentagon.com>

On 27 Jul 1999 22:44:20 -0500, Abigail <abigail@delanet.com>, in
<slrn7psv3n.3hu.abigail@alexandra.delanet.com> wrote:

+ Don't forget, when it comes to the web, the evil character is Netscape,
+ way more than MS.

No, it is (was?) a constant contest to see who could do the most evil.

James


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

Date: Wed, 28 Jul 1999 14:20:52 GMT
From: walter@io.frii.com (Walter Pienciak)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <8lEn3.138$H3.188105728@news.frii.net>

Hi, 
 
You might also want to take a look at     
 
    http://www.stonehenge.com/merlyn/WebTechniques/col36.html 
 
Walter

In article <379deae4.354355@news.sprint.ca>,
Wayne Venables <wvenable_net@iname.com> wrote:
>On Tue, 27 Jul 1999 17:15:51 +0200, "Philip 'Yes, that's my address'
>Newton" <nospam.newton@gmx.net> wrote:
>
>>Wayne Venables wrote:
>>> 
>>>     Does anyone have any code to retrieve the height and width of GIF
>>> and JPEG files?
>>
>>I'd say this is a FAQ. Doesn't that mean this should find its way into
>>the regular Perl documentation? 
>
>  I (the person who asked the orginal question) did do a search on
>CPAN for a module to do this.  I just searched for "GIF JPEG" / 
>"GIF JPG" (on the description) assuming that it would find any modules
>related to image processing.  I don't know why it didn't find the
>Image::Size module.  
>
>  But since searching CPAN is a logical thing to do (even for a
>someone as unfamiliar with Perl as me - I've only been using it for
>about 3 months), it probably doesn't need a FAQ entry.
>
>My 2 cents,
>




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

Date: Wed, 28 Jul 1999 14:42:23 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <jFEn3.2866$nB.428994@news.itd.umich.edu>

In article <slrn7psv3n.3hu.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Don't forget, when it comes to the web, the evil character is Netscape,
>way more than MS.

*blink*

You don't say.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Wed, 28 Jul 1999 09:12:44 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Help or possibly stupid syntax suggestion re: foreach
Message-Id: <379F0FDC.F30923B7@texas.net>

Adrian Pepper wrote:
> 
> If what you want to do is:
> 
>     foreach ($a,$b) (@list) {
>        ...
>     }
> 
> Adrian Pepper

Larry has already given you a number of suggestions using arrays, but
perhaps using a hash is a possibility(?).

- Tom


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

Date: 28 Jul 1999 06:07:59 -0600
From: llornkcor <llornkcor@llornkcor.com>
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <yag1rn8g.fsf@wind.localdomain>

Have you tried the perl command system? This mightwork.




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

Date: Wed, 28 Jul 1999 14:35:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <37a31487.1973345@news.skynet.be>

Tim Nettleton wrote:

>I have need to run a batch file that requests nslookup and ping information
>on several hosts.  I would like to have a form on a page that someone can
>just type in the IP or domain and then the .bat file will run in the
>CGI-BIN.  I have a unix server and a NT server.
>
>Is this possible?

Not on Unix. :-)

But on PC, you can run a BAT file from within perl, and even capture the
(STDOUT) output in a variable, with this syntax:

	$captured = `c:\\path\to\batch.bat`;

I'm not too sure if you may replace the backslash with a forward slash.

   HTH,
   Bart.


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

Date: 28 Jul 1999 12:47:05 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Korn Shell or Perl?
Message-Id: <7nmu49$asp$1@lublin.zrz.tu-berlin.de>

brian d foy <brian@pm.org> wrote in comp.lang.perl.misc:

[...]

>i just re-read "The Psychology of Computer Programming" which has
>been re-printed for it's 25th aniversary.  there's a chapter devoted
>to learning a new language when you already know one.  it seems most
>people, instead of learning the new language, just squeeze the syntax
>of the new language to fit their old ideas.   thus, any new language
>will not be useful because one doesn't benefit from it differences
>with the previous langauge.  such is the case of the original
>poster, it seems.

Yes, that seems to be a waste.  On the other hand, it reminds me
of a few years when I had to use quite a few different languages,
either simultaneously on part time jobs, or in quick succession on
different jobs.  During that period I deliberately reduced my
programming techniques to if-constructs, while-loops and breaking
out subroutines when pieces of code got too long.  Oh, and recursion,
when available.  I even emulated while-loops in fortran when it didn't
have them.  Only when these were hopelessly inadequate (which rarely
happened) did I turn to the manual to see what else the language
offered.  I wrote some big and clumsy programs that way, but could
turn from one to the other with ease.  Sort of high level RISC
technique...

Anno


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

Date: 28 Jul 1999 13:02:04 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: negated compiled regexp
Message-Id: <7nmv0c$4km$1@rguxd.viasystems.com>

Abigail <abigail@delanet.com> wrote:
:>lt lindley (ltl@rgsun5.viasystems.com) wrote on MMCLVII September
:>MCMXCIII in <URL:news:7nlp9c$oqb$1@rguxd.viasystems.com>:
:>:: 
:>:: Looks like I have some boundary condition issues here.  I'll try the
:>:: recommended way again:
:>:: 
:>::   DB<3> $rex = qr/^(?:(?!PAT).)*$/
:>::   DB<4> $val = 'PAT'
:>::   DB<5> print 'true' if ($val =~ $rex)
:>:: true

:>That's strange.

:>$ perl -wle 'print "true" if "PAT" =~ /^(?:(?!PAT).)*$/'
:>$ perl -wle '$regex = qr /^(?:(?!PAT).)*$/; print "true" if "PAT" =~ $regex'
:>$ perl -wle '$regex = qr /^(?:(?!PAT).)*$/; print "true" if "PAT" =~ /$regex/'
:>$ perl -wle '$regex = qr /^(?:(?!PAT).)*$/; $val = "PAT";
:>              print "true" if $val =~ /$regex/'
:>$

:>Perhaps a bug in the debugger? Nope...

:>  DB<1> print "true" if "PAT" =~ /^(?:(?!PAT).)*$/

:>  DB<2>


:>What version of Perl are you using?

This is perl, version 5.005_02 built for sun4-solaris

I know it is out of date, but golly, it was the standard release
only a few short months ago.  :-)

I'll upgrade and then try again to unravel all of the ramifications
of negative lookahead assertions.  Bug notwithstanding, I
still don't grok this fully. 

Noone has commented on my assertion that there is a need
for a simpler way to build a "!~" compiled regular expression.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: 28 Jul 1999 13:48:15 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: negated compiled regexp
Message-Id: <7nn1mv$52v$1@rguxd.viasystems.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:>     [courtesy cc of this posting mailed to cited author]

:>In comp.lang.perl.misc, 
:>    lee.lindley@viasystems.com writes:
:>:So, how to compose a re that is a negated re?  

:>I just posted this.  It's in the Cookbook.  Here's the short answer:

:>    /^(?:(?!PAT).)*$/s

I didn't look hard enough.   Recipe 6.17 discusses this problem
domain at length.

Sorry for wasting everyone's time.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: 28 Jul 99 12:15:00 GMT
From: pijll@phys.uu.nl (Eugene van der Pijll)
Subject: Re: Newbie Q: Replacing a string by an array
Message-Id: <pijll.933164100@ruunat.phys.uu.nl>

In <kCkLqCAxIun3Ew5R@beausys.demon.co.uk> Andrew Fry <andrewf@beausys.demon.co.uk> writes:

>However, when I find the line and do the replacement, using a
>statement of the form s/$tag/@B/, and then print the new
>(modified) array A, it appears that each line in array B of the
>form xxx\n comes out as xxx\n FOLLOWED BY A SPACE.
>Why is this, and how can I get rid of this extra space ?

Try setting $" to undef. See perlvar for details.
--
         \
      Eugene van der Pijll  : pijll@phys.uu.nl
--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--


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

Date: Wed, 28 Jul 1999 23:02:38 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Newbie Q: Replacing a string by an array
Message-Id: <MPG.1209aa7e1cc23fe7989b9a@news-server>

Andrew Fry writes ..
>However, when I find the line and do the replacement, using a
>statement of the form s/$tag/@B/, and then print the new
>(modified) array A, it appears that each line in array B of the
>form xxx\n comes out as xxx\n FOLLOWED BY A SPACE.
>Why is this, and how can I get rid of this extra space ?
>
>      $a[$i] =~ s/fleece/@b/;

a substitution string is treated like a double quoted string .. array 
variables when interpolated into a double quoted string have their 
elements joined using the value of $" .. this is space by default

  perldoc perldata

and

  perldoc perlvar

-- 
 jason - remove all hyphens for email reply -


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

Date: 28 Jul 1999 14:05:30 GMT
From: campbell-lange@easynet.co.uk (Rory C-L)
Subject: Newbie sort and references question.
Message-Id: <campbell-lange-2807991505080001@campbell-lange.easynet.co.uk>

I have a sets of records some of which belong to the same "issue number"

i.e.
Issue     Date     Number          Revision
636/1999     23/2/99  A/LB/10/00/229  D                        
780/1999     21/4/99  A/LB/10/00/249  C 
874/1999      1/6/99  A/LB/10/01/003  R                          
780/1999     14/1/99  A/LB/10/02/028  C                                
487/1998     4/12/98  A/LB/10/04/021  J 

I'd like to sort the records by number, collected by Issue.
I split the records into issue and @rest.
Then I want to $hash{$issue} = [@rest], unless $hash{$issue} already exists,
in which case I'm using $hash{$issue} .= [@rest]. However THEN I have two
refs appended to each other, rather than an array of refs.
Should I initialise $hash{$issue} = []; then push subsequent array refs to it?
I'm a bit confused.

A related sort question:

I have a hash structured like this:

   key   value (ref to anonymous array) 
    |      |
    x    (anonymous) array with refs to 1 .. n anonymous arrays
           |
         array array array
           |
         first element
         
         
I'd like to sort a hash by the 1st element of the 1st array of the array
referenced by value.
The structure of the element is a set of numbers followed by a '/' then
some letters. Its only the numbers I'm interested in.

Thanks for any help
Rory

-- 
Rory Campbell-Lange
The Campbell-Lange Workshop


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

Date: 28 Jul 1999 12:39:36 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: Orwant book status? (was Re: stopping email)
Message-Id: <7nmtm8$r2f$1@aurwww.aur.alcatel.com>

On Tue, 27 Jul 1999 23:42:08 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
  > Heck, no.  The freebie last year was that little, nominally $5, Perl 
  > reference guide.  I paid solid (HP) cash for the Ram, when they dragged 
  > a second batch in late in the week.

If you registered early, the Ram was your freebie book.  That's how I
got mine. :-)

-- 
John Klassa / Alcatel USA / Raleigh, NC, USA


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

Date: 28 Jul 1999 08:43:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Pass by value or pass by reference?
Message-Id: <slrn7pu26q.4br.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLVII September MCMXCIII in
<URL:news:x73dy9tfdc.fsf@home.sysarch.com>:
 .. 
 .. in any case, passing in an array and processing its elements by
 .. reference to modify them is usually not clear code and is probably
 .. better done by passing in a ref to the array and then modifying the
 .. elements.


Why not? People do it with foreach() all the time. Why would be doing
that in foreach() be clear code, but not when it's a sub?

Besides, how else is one going to make a sub similar to chop()?



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== 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: Wed, 28 Jul 1999 09:58:28 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: perl port to windows CE ?
Message-Id: <379F1A94.564CF0D@bus-prod.com>

Has there been any action to port perl to windows CE? Not the whole
thing and all the libs, but at least the core, and maybe the CGI and OLE
modules as pre-compiled binaries? 

The PPC and HPC devices are starting to be pretty good, but with the
lack of available software, perl sure would be a great help. Especially
for leveraging local browsers to run utilities when offline. The windows
CE environment is sadly lacking in decent front-end tools right now for
any kind of custom programming...

If a subset of perl and a mini local webserver were available on CE, it
would open up a whole new world!

-- 
Thanx, Dan

# If you would like to reply-to directly, remove the - from my username
* no spam please... regulated by US Code Title 47, Sec.227(a)(2)(B)  *


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

Date: Wed, 28 Jul 1999 13:22:17 +0200
From: Herger Peter <peter.herger@swisslife.ch>
Subject: perl to excel
Message-Id: <379EE7E9.BC93C4C2@swisslife.ch>

Hello

I've extracted some datas from MIB tables using an perl script. Now I've
wrote this datas to an *txt File. How can I write this datas directly to
an Excel Sheet???

Thanks

Peter Herger



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

Date: Wed, 28 Jul 1999 13:02:21 GMT
From: "christopher j. hradil" <chradil@acuitive.com>
Subject: Re: perl to excel
Message-Id: <xbDn3.79655$eF3.24784@news.rdc1.nj.home.com>


Herger Peter <peter.herger@swisslife.ch> wrote in message
news:379EE7E9.BC93C4C2@swisslife.ch...
> Hello
>
> I've extracted some datas from MIB tables using an perl script. Now I've
> wrote this datas to an *txt File. How can I write this datas directly to
> an Excel Sheet???
>
> Thanks
>
> Peter Herger
>

Peter,
 you should be able to paste this code into notepad and run it, provided you
have the
perl OLE module installed and excel as well.

#!c:\\perl\\bin
#  --*-- perl --*--
use OLE;

$application = CreateObject OLE 'Excel.Application' || die $!;

$application->{'Visible'} = 1;
$workbook = $application->Workbooks->Add();
$worksheet = $workbook->Worksheets(1);
$worksheet->Range("A1:D1")->{'Value'} = ["North","South","East","West"];
$worksheet->Range("A2")->{'Value'} = 5.2;
$worksheet->Range("B2")->{'Value'} = 10;
$worksheet->Range("C2")->{'Value'} = 8;
$worksheet->Range("D2")->{'Value'} = 20;

$range = $worksheet->Range("A1:D2");
$chart = $workbook->Charts->Add;

#$chart->ChartWizard(range,"x13DPie",7,"x1Rows",1,0,2,"Sales Percentages" );

$workbook->{'Saved'} = 1;

$application->ActiveWorkbook->Close(0);
$application->Quit();




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

Date: Wed, 28 Jul 1999 05:04:52 -0800
From: Samay <anonymous@web.remarq.com>
Subject: Re: perl to excel
Message-Id: <933167096.8324@www.remarq.com>

use Win32::OLE
$x1 = new Win32::OLE("Excel.Application",'Quit');
read Perl Resource Kit,



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


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

Date: Wed, 28 Jul 1999 08:48:16 -0500
From: Nathan Schumann <nds@instrumental.com>
Subject: Premature end of script headers???
Message-Id: <379F0A20.24142F94@instrumental.com>

Hello All,

I am fairly new to perl and am trying to run a simple cgi script through
my web server to return some html.  However, nothing happens when
I access the page where the <!--#exec cgi="app.cgi"--> call is.  Below
is the error I get from the server's error log:

[Wed Jul 28 08:04:37 1999] access to /my/dir/app.cgi failed for
my.client.com,
reason: Premature end of script headers

The file has the correct permissions on it: 755.  I have checked my
script over and over as well as used syntax checking.  I can also run it
from the UNIX prompt by typing: perl app.cgi.

Any help would be greatly appreciated.  Thanks.





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

Date: Wed, 28 Jul 1999 04:06:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: print problem
Message-Id: <gmdmn7.3um.ln@magna.metronet.com>

Tom Beauchamp (acafounder@crosswinds.net) wrote:
: How can I include quotes in a perl print statement.  Say I want to output
: this in my script:

: <font face="Arial, Helvetica, sans-serif">Whatever</font>

: I tried \" and "" but they didn't seem to work.
          ^^
          ^^


   Let's see your code where that didn't work. Looks fine to me.


   Since you don't have any variables to interpolate nor backslash
   escape sequences, you do not need (and should therefore not use)
   double quotes.

   So use single quotes:

      print '<font face="Arial, Helvetica, sans-serif">Whatever</font>';


   If you need one of the 2 things that double quotes adds 
   over and above what you get with single quotes, you can 
   also use "alternate quoting" (recommended over backwacking):

      print qq(<font face="Arial, Helvetica, sans-serif">$text</font>);



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 28 Jul 1999 13:28:50 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: reg expression
Message-Id: <slrn7pu1gn.gad.fl_aggie@thepentagon.com>

On Wed, 28 Jul 1999 08:36:20 GMT, I.J. Garlick <ijg@connect.org.uk>, in
<FFKnwK.H7p@csc.liv.ac.uk> wrote:

+ By then however the mistake is in black and white

And in deja.com until the end of time...hmmm...

use Time::EndOf;

James


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

Date: Wed, 28 Jul 1999 23:04:00 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Standard Unix Compress
Message-Id: <MPG.1209aaced4a59141989b9b@news-server>

"bob" <bbo>
       ^^^

the only sign of intelligence here

-- 
 jason - remove all hyphens for email reply -


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

Date: 28 Jul 1999 14:55:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using perl with another language?
Message-Id: <7nn5l8$b3r$1@lublin.zrz.tu-berlin.de>

George hart  <hart@rohan.sdsu.edu> wrote in comp.lang.perl.misc:
>
>
>Hi
>
>I am a beginning programmer who would like some advice using perl
>combined with other languages.  Right now I have a project in C that
>deals with some heavy text manipulation which is easy in Perl but a
>disaster in C.   I am tempted to do a few system calls to Perl in my C
>program but I cannot help to wonder: (1) is this considered good
>programming?  (2) Are there serious perfomance issues?  (3) Is there a
>standard way to intermix programming languages?

Well, a system() call, if that's what you mean, will have to start a
child process, load the perl interpreter, have it translate your
program and spit out the result, probably to a temp file for your
program to pick up.  That may be adequate or not, depending on your
problem.  You can save some of the overhead by including the perl
interpreter in your program.

perldoc perlembed will get you started.

Anno


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

Date: Wed, 28 Jul 1999 15:44:34 +0100
From: John Imrie <jimrie@guideguide.com>
Subject: Re: Which group is appropriate?
Message-Id: <379F1752.A1863FDB@guideguide.com>

>
> I dunno the answer, but I think a c.l.p.novice group might cut the
> level of invalid posts to this group.  Non hackers would be more
> apt to stay in a group in which they felt less threatened.
>

How about creating a c.l.p.hackers group.

Any one from M/Soft or AOL will keep well away from that as every one
knows that Hackers are evil scheming people , trying to over through all
that is good and holy.


The Pilgrim.



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

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


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