[9696] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3290 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 29 21:05:32 1998

Date: Wed, 29 Jul 98 18:00:53 -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           Wed, 29 Jul 1998     Volume: 8 Number: 3290

Today's topics:
        # in a print statement nikkim@my-dejanews.com
    Re: # in a print statement (Josh Kortbein)
    Re: # in a print statement (Ronald J Kimball)
        AS400 and perl examples tjbynum@my-dejanews.com
        AS400 and Perl tjbynum@my-dejanews.com
    Re: Cookie File (Ronald J Kimball)
        Coverage Tool? <shenge@ece.ucdavis.edu>
        cperl-mode vs vi <ix@maz.org>
    Re: file system operations on open files (Ilya Zakharevich)
    Re: file system operations on open files (Mark-Jason Dominus)
        Generating multiple pages in one script <slindsey@students.wisc.edu>
    Re: Getopt::Std leaves =?ISO-8859-1?Q?=24opt=5FXXX=B4s? (Ronald J Kimball)
    Re: How to delete files inside perl script? (Jon Bell)
        How to extrat characters from string <chapin@ecst.csuchico.edu>
    Re: How to extrat characters from string (Josh Kortbein)
    Re: How to extrat characters from string (Ronald J Kimball)
    Re: Interesting Question needs Quick Answer (Miguel Cruz)
        linking Perl to a DLL in NT (Eric W. Bressler)
        Method not implemented <tobym@mobiletel.com>
    Re: open IN, "file " or die <= it dies! (Keith Thompson)
    Re: open IN, "file " or die <= it dies! (Tad McClellan)
    Re: pattern matching <qcoldiro@deal.unl.edu>
        perl 32bit <philey@hotmail.com>
        Perl 5.00501 and Perl.dll (Jason V. Robertson~)
    Re: Perl variable types problems (Ronald J Kimball)
    Re: Problems building 5.005_01 on NT4, sp3 (Troy Denkinger)
    Re: Q: lpd / sockets / perl / HP750 plotters (Will Morse)
    Re: Q: lpd / sockets / perl / HP750 plotters (Neal P. Murphy)
        reinterpolation without eval; weak eval; qqq/STRING/ ? <david@kasey.umkc.edu>
    Re: removing accented characters from a string (Ronald J Kimball)
    Re: sytem( ) calls in CGI scripts <jdw@dev.tivoli.com>
    Re: Y2K problem in PERL with localtime() (Ronald J Kimball)
    Re: Year 2000 (Tad McClellan)
    Re: Year 2000 (Miguel Cruz)
    Re: Year 2000 (Josh Kortbein)
    Re: Year 2000 (Michael J Gebis)
    Re: Year 2000 (I R A Aggie)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 29 Jul 1998 21:48:32 GMT
From: nikkim@my-dejanews.com
Subject: # in a print statement
Message-Id: <6po5bg$ol2$1@nnrp1.dejanews.com>

When writing a cgi perl script, is it possible to have a # character in a
print statement.  For example, if I am having the script print out an html
page, and I would like to have this line in the script:

print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562 SRC=\"./bbstop8.jpg\"
BORDER=0 USEMAP="#map5" > etc, etc ...

How can I get the #map5> to not be recognized as a comment??  Is this
possible?

Thanks,
Nikki Michalowske

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 29 Jul 1998 23:11:27 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: # in a print statement
Message-Id: <6poa6v$ada$2@news.iastate.edu>

nikkim@my-dejanews.com wrote:
: When writing a cgi perl script, is it possible to have a # character in a
: print statement.  For example, if I am having the script print out an html
: page, and I would like to have this line in the script:

: print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562 SRC=\"./bbstop8.jpg\"
: BORDER=0 USEMAP="#map5" > etc, etc ...

: How can I get the #map5> to not be recognized as a comment??  Is this
: possible?

# is not a character you should need to escape:

#!/usr/local/bin/perl5 -w

use strict;

print "This is a test of printing the # sign.\n";


You must have a bug elsewhere in your code. Like, for example, above
where you say USEMAP="#map5" without escaping the doublequotes.




Josh

--

__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
            - Thomas Pynchon



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

Date: Wed, 29 Jul 1998 20:34:10 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: # in a print statement
Message-Id: <1dcy04p.1kh7u371ia3kwmN@bay1-90.quincy.ziplink.net>

<nikkim@my-dejanews.com> wrote:

> When writing a cgi perl script, is it possible to have a # character in a
> print statement.  For example, if I am having the script print out an html
> page, and I would like to have this line in the script:
> 
> print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562 SRC=\"./bbstop8.jpg\"
> BORDER=0 USEMAP="#map5" > etc, etc ...
                  ^     ^

Backslash the quotes so the # is within the string, instead of outside
it.

-- 
 _ / '  _      /         - 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: Wed, 29 Jul 1998 21:52:39 GMT
From: tjbynum@my-dejanews.com
Subject: AS400 and perl examples
Message-Id: <6po5j6$oo1$1@nnrp1.dejanews.com>

Hello All,
I was wondering if someone could send a few perl scripts that they've
written for the AS400.  Right now I'm not able to get any of the
examples to work.  I've tried quite a few of them, but get nothing.
I have tried something once inside the perl shell like a simple hello
world and it seems to work, but only after pressing the F4=End of
File key.  Then it will print out the "Hello World".  Are there any
examples readily available on the internet somewhere.  How does one
go about executing RPG programs and the like from within perl.  Is it
possible to access database files, etc. on the AS400?

Many Thanks,
Tim

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 29 Jul 1998 22:12:53 GMT
From: tjbynum@my-dejanews.com
Subject: AS400 and Perl
Message-Id: <6po6p5$qee$1@nnrp1.dejanews.com>

Hello All,

Could someone point me to some resources regarding Perl on the AS/400?	I've
got It installed (Risc v4r2) and the install went without a hitch, but I'm
not sure how to run any of the examples, or at least I'm not getting anything
back when I run ctime.pl for example.  How does one run the test-suite off
the AS/400?

Also the only time I can get anything to print out to the screen is if I run
the perl shell and type something in like print "Hello World!"; and the press
F4 for the end of file and then it wants me to hit RETURN to end the terminal
session. Anyway to get this to work without exiting the shell?	Is there any
way to call RPG's or CL's or work with database files on the AS/400 from
perl?  Can one print to a printer attached to the AS/400?  If so how?

If anyone could supply any examples I would greatly appreciate any and all
help.

Best Regards,
Tim

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 29 Jul 1998 20:34:11 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Cookie File
Message-Id: <1dcy0e9.1hfai771h51jggN@bay1-90.quincy.ziplink.net>

Daniel <dan@NOSTINKINSPAM.nwsl.west.ga.net.> wrote:

> print "Set-Cookie:ORDER=",$name,"; path=/; expires=Wednesday, 09-Nov-99
> 23:12:40 GMT
> ";    
> print "\n";
> 
> 
> Notice that the "; is on a seperate line. For some reason my scripts bomb if
> it is on the same line as the cookie statement

Probably because HTTP headers must be separated from the content by two
newlines.  With "; on the following line, you have the literal \n within
that string, plus the "\n" being printed in the next print statement.
With "; on the same line, you only have the "\n" newline.

You could change the above to

print "Set-Cookie:ORDER=",$name,"; path=/; expires=Wednesday, 09-Nov-99
23:12:40 GMT\n\n";

and it should still work.

-- 
 _ / '  _      /         - 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: 29 Jul 1998 23:42:30 GMT
From: Eric Sheng <shenge@ece.ucdavis.edu>
Subject: Coverage Tool?
Message-Id: <6poc16$rnt$1@mark.ucdavis.edu>

Hi all,

	I am testing a perl script somewhere in the 2000 lines neighborhood.
I was wondering if there is any tools out there or inside the perl debugger
that would keep track of which lines of the script has been hit or executed
during run-time.  I basically wants to make sure every line of my code has
been tested.  Thanks a lot.

--Eric


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

Date: Wed, 29 Jul 1998 15:34:16 -0700
From: Brian Moseley <ix@maz.org>
Subject: cperl-mode vs vi
Message-Id: <35BFA368.61934CF6@maz.org>

i use emacs (just started using cperl-mode), the rest of my team uses emacs.
they check in code with tabs, i check in code with spaces. heartache ensues.

i've explored a bit, and it seems that cperl-mode, perl-mode, c-mode, java-mode
all indent with spaces, none with tabs. fine. it sounds like i need some type of
perl-mode hook that will run through the entire buffer and replace each tab
character with the appropriate number of spaces. anything like that built into
cperl-mode or emacs that i dont know about? alternatively, is there a variant of
indent for perl that would achieve the same effect?

-- 
Brian Moseley
Agent of Chaos - Critical Path


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

Date: 29 Jul 1998 22:44:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: file system operations on open files
Message-Id: <6po8ke$p0d$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Mark-Jason Dominus
<mjd@op.net>],
who wrote in article <6pnnim$gra$1@monet.op.net>:
> In article <35BF558B.2BAE83D5@waii.ERASETHIS.com>,
> Marcelo L. Meira <marcelo.meira@waii.ERASETHIS.com> wrote:
> >I assumed Unix
> >was the (only) OS in question here.
> 
> It is.  Ilya was making a joke.  Larry is just confused.

I was not.  You do not play with the word 'portable' on c.l.p.m.

Ilya


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

Date: 29 Jul 1998 19:44:58 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: file system operations on open files
Message-Id: <6poc5q$o5p$1@monet.op.net>

In article <6po8ke$p0d$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>>  Ilya was making a joke.  
>
>I was not.  You do not play with the word 'portable' on c.l.p.m.

Pardon me; I was misled by your use of the `:-)' symbol, and by the
fact that your complaint made no sense.

Maybe someone else explain to me why we need to worry about DOS
filesystem compatibility in a program for modifying the Unix password
file.



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

Date: Wed, 29 Jul 1998 15:58:27 -0500
From: Scott Lindsey <slindsey@students.wisc.edu>
Subject: Generating multiple pages in one script
Message-Id: <35BF8CF3.1B95741@students.wisc.edu>

This is a newbie question I'm sure, but how do I make a script generate
one page at the beginning of it's execution and then another one at the
end?  When I tried this the first time it simply tacks the second page
onto the end of the first without "clearing" the page.  Basically I want
to generate a "Please wait..." page while the script crunches a bunch of
numbers and then follow it with a report.

Please email response.

Thanks,
-Scott Lindsey
lindsey@cs.wisc.edu



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

Date: Wed, 29 Jul 1998 20:34:13 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Getopt::Std leaves =?ISO-8859-1?Q?=24opt=5FXXX=B4s?= UNDEFINED
Message-Id: <1dcy1ji.axal4b5rqpvqN@bay1-90.quincy.ziplink.net>

Dave Barnett <barnett@houston.Geco-Prakla.slb.com> wrote:

> if (defined($opt_a) and $opt_a) {
>     print "opt_a set\n";
> }

The call to defined is redundant, as undef is a false value, and
evaluating undef in a boolean context does not give a warning.

In other words, this would be sufficient:

if ($opt_a) {
    print "opt_a set\n";
}

-- 
 _ / '  _      /         - 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: Wed, 29 Jul 1998 22:02:59 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: How to delete files inside perl script?
Message-Id: <EwvMKz.LI0@presby.edu>

In article <35BF7F8C.54097DFA@hotmail.com>,
Meena Chockalingam  <cmeena@hotmail.com> wrote:
>I used unlink and it does not work either.

Well, can you show us the actual code that you tried to use, then?

-- 
Jon Bell <jtbell@presby.edu>


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

Date: Wed, 29 Jul 1998 15:29:01 -0700
From: Juan Guevara <chapin@ecst.csuchico.edu>
Subject: How to extrat characters from string
Message-Id: <Pine.HPP.3.95.980729152433.6466B-100000@cancer.ecst.csuchico.edu>

Hello,

How do you get a character from a string, specifying
the index where it is located.  For example, if I say:

$index=index $string,$findthis;

Is there a function that does the following:
$char = get_me_character_at_$index($string);

thanks, -juan
--
Juan Guevara            
chapin@ecst.csuchico.edu        *Make every move as if it were your last*
http://www.ecst.csuchico.edu/~chapin         



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

Date: 29 Jul 1998 23:09:30 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: How to extrat characters from string
Message-Id: <6poa3a$ada$1@news.iastate.edu>

Juan Guevara (chapin@ecst.csuchico.edu) wrote:
: Hello,

: How do you get a character from a string, specifying
: the index where it is located.  For example, if I say:

: $index=index $string,$findthis;

: Is there a function that does the following:
: $char = get_me_character_at_$index($string);

perldoc -f substr






Josh

--

__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
            - Thomas Pynchon



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

Date: Wed, 29 Jul 1998 20:34:14 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: How to extrat characters from string
Message-Id: <1dcy259.18vqjm01wlph1N@bay1-90.quincy.ziplink.net>

Juan Guevara <chapin@ecst.csuchico.edu> wrote:

> How do you get a character from a string, specifying
> the index where it is located.  For example, if I say:
> 
> $index=index $string,$findthis;
> 
> Is there a function that does the following:
> $char = get_me_character_at_$index($string);

Yes.  You want to use substr for that.

$index = index($string, $findthis);
$char = substr($string, $index, 1);


Of course, this would work just as well:

$char = substr($findthis, 0, 1);

;-)

-- 
 _ / '  _      /         - 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: 29 Jul 1998 23:04:37 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <6po9q5$n5f$1@news.ycc.yale.edu>
Keywords: Perl script problem

P.L. Hegarty <sm8plh@csc.liv.ac.uk> wrote:
> Firstly I will apologise if this question is answered anywhere else, but
> I'm in a bit of a rush and have not been able to get the FAQ for this
> group yet.

http://rtfm.mit.edu - all the FAQs you'll ever need.

> I want to write a perl script which produces as its output an exact copy
> of itself. So when you run the script you get exactly the same output to
> screen as if you used 'cat' or 'type'. You can not read anything into the
> script or use any system calls. That last bit is the heart of the problem.

This, my friends, is a homework assignment if I've ever seen one. Patrick,
how are you going to learn anything if you have people from the newsgroup
write your programs for you?

miguel


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

Date: Wed, 29 Jul 1998 21:43:13 GMT
From: ebressler@netegrity.com (Eric W. Bressler)
Subject: linking Perl to a DLL in NT
Message-Id: <35bf970a.86582359@argand.security.com>

I am trying to have a perl script use the functions in a windows DLL
file.  I see that there is some way to link C code to perl but all the
explinations are for Unix.  I need to know how to link them in NT.
Please help out if you can.


Eric W. Bressler

Ebressler@netegrity.com


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

Date: Wed, 29 Jul 1998 16:37:53 -0500
From: "TM" <tobym@mobiletel.com>
Subject: Method not implemented
Message-Id: <6po4u5$iek$1@fox.comm.net>

I get the following msg when trying to submit a guestbook entry, any
suggestions?


Method not implemented

POST to /~sportsman/cgi-bin/guestbook.pl not supported.




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

Date: 29 Jul 1998 21:23:57 GMT
From: kst@king.cts.com (Keith Thompson)
Subject: Re: open IN, "file " or die <= it dies!
Message-Id: <901747437.987223@wagasa.cts.com>

mickghazey@my-dejanews.com wrote:
> I'm unable to open a file name that has a trailing space.

This is actually mentioned in the on-line documentation for "open".
Here's the relevant passage from the 5.004_04 docs.

             The filename that is passed to open will have
             leading and trailing whitespace deleted.  To open a
             file with arbitrary weird characters in it, it's
             necessary to protect any leading and trailing
             whitespace thusly:
 
                 $file =~ s#^(\s)#./$1#;
                 open(FOO, "< $file\0");

Personally, I think this is a misfeature.  Note that the solution
(prepending "./" )is Unix-specific (unless Perl magically makes it work
on other systems).

You can also use sysopen.

-- 
Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> <*>
Qualcomm, San Diego, California, USA  <http://www.qualcomm.com>
It takes a Viking to raze a village.


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

Date: Wed, 29 Jul 1998 17:01:27 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: open IN, "file " or die <= it dies!
Message-Id: <n36op6.uh3.ln@localhost>

mickghazey@my-dejanews.com wrote:
: I'm unable to open a file name that has a trailing space.

: open IN, "file " or die; <= this dies!


Waddy know? 

Just like the description for open() in perlfunc says:

-------------------
The filename that is passed to open will have leading and trailing
whitespace deleted.  To open a file with arbitrary weird
characters in it, it's necessary to protect any leading and trailing
whitespace thusly:

    $file =~ s#^(\s)#./$1#;
    open(FOO, "< $file\0");
-------------------


So,

   open IN, "file \0"  or die;



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


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

Date: Wed, 29 Jul 1998 16:25:33 -0500
From: quinn coldiron <qcoldiro@deal.unl.edu>
Subject: Re: pattern matching
Message-Id: <35BF934D.5F8A9CF9@deal.unl.edu>

>

Thanks all for the suggestions.  I ended up doing this:

@files = `find $base -type d`;

where $base is my starting point to search for all sub directories.  Works
well.

Thanks to John Adams, I didn't know about the perlfunc man page.  I just
printed it out (I'm a hard copy person).
I like the substr function, and have needed it for other projects.

I'm just REALLY getting into Perl and love it.

quinn

--
------------------------------------------
Quinn P. Coldiron
DEAL Lab
03 AG Comm
472-5249
qcoldiro@unlinfo.unl.edu
******* http://citv.unl.edu/linux/ *******
------------------------------------------





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

Date: Thu, 30 Jul 1998 00:18:01 +0200
From: "philey" <philey@hotmail.com>
Subject: perl 32bit
Message-Id: <6po72t$4qg$1@usenet40.supernews.com>

hey.
where can i get the perl compiler for windows 95?

thanks





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

Date: 30 Jul 1998 00:27:01 GMT
From: jvrobert@sedona.intel.com (Jason V. Robertson~)
Subject: Perl 5.00501 and Perl.dll
Message-Id: <6poekl$g4d@news.or.intel.com>

Hi,

Does anyone know how to change the name of the Perl dll to, say,
perl500501.dll?  I tried changing it in the Makefile and it makes the proper
perl500501.dll, but perl.exe still tries to import perl.dll for some reason.

We need a unique DLL name across perl versions.

Thanks,
Jason
-- 
|Jason V. Robertson <jason.v.robertson@intel.com> |
|Not speaking for Intel.                                 |


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

Date: Wed, 29 Jul 1998 20:34:15 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl variable types problems
Message-Id: <1dcy2q8.mtbd3qrbp7g8N@bay1-90.quincy.ziplink.net>

[posted and mailed]

Thomas van Gulick <melkor@valimar.middle.earth> wrote:

> ${$clan_one}{GAMETYPES} = 31;
> ${$form}{GAMETYPE}      = 4;
> 
> then ${$clan_one}{GAMETYPES} & ${$form}{GAMETYPE} results in 0 instead of
> the expected 4.

It works for me...

  DB<1> $clan_one = {}

  DB<2> $form = {}

  DB<3> ${$clan_one}{GAMETYPES} = 31

  DB<4> ${$form}{GAMETYPE}      = 4

  DB<5> x ${$clan_one}{GAMETYPES} & ${$form}{GAMETYPE}
0  4


Perhaps your problem is that the values are actually strings and not
numbers?

  DB<6> ${$clan_one}{GAMETYPES} = '31'

  DB<7> ${$form}{GAMETYPE}      = '4'

  DB<8> x ${$clan_one}{GAMETYPES} & ${$form}{GAMETYPE}
0  0
  DB<9> 

If so, you might want to read about the bitwise & operator in the perlop
documentation.

-- 
 _ / '  _      /         - 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: Wed, 29 Jul 1998 22:23:45 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: Problems building 5.005_01 on NT4, sp3
Message-Id: <6po7cv$aap$1@hirame.wwa.com>

cc'd to the original poster

In article <35BE8D8D.C03EF75D@selectst.com>, David Coldrick 
<davidc@selectst.com> wrote:
>CCHOME          = C:\Program Files\DevStudio\VC

For lack of a better answer, I'll go out on a limb and 
suggest that the problem is in the space in this path.

Regards,

Troy Denkinger


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

Date: Wed, 29 Jul 1998 22:26:21 GMT
From: wtm001@anadarko.com (Will Morse)
Subject: Re: Q: lpd / sockets / perl / HP750 plotters
Message-Id: <Ewvnnx.1xn@anadarko.com>


Never mind, stoopid stoopid error.  It seems the best way to find 
a stupid error is to post something on the net, then you will
turn right around and see it.  Damn!!

(the data file has a \2 that should be \3)

Will

Will Morse (wtm001@anadarko.com) wrote:
: Hi,

: As I have previously posted, I am writing a specialized plotter
: interface to some HP 750 plotters that have a Jet Direct card in
: them.  The JetDirect has an lpd interface so I am trying to write 
: to that.  I am writing the interface in perl 5.004_03.

: I have written a "test rig" to try to copy files to the plotter
: via the socket interface, and that program is shown below.



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

Date: 29 Jul 98 21:55:02 GMT
From: murphyn@orca.cig.mot.com (Neal P. Murphy)
Subject: Re: Q: lpd / sockets / perl / HP750 plotters
Message-Id: <murphyn.901749302@orca>

wtm001@anadarko.com (Will Morse) writes:

>Hi,

>As I have previously posted, I am writing a specialized plotter
>interface to some HP 750 plotters that have a Jet Direct card in
>them.  The JetDirect has an lpd interface so I am trying to write 
>to that.  I am writing the interface in perl 5.004_03.

>I have written a "test rig" to try to copy files to the plotter
>via the socket interface, and that program is shown below.

>The problem I am having is that about 380 characters into the
>third message (the "data" file) I lose the connection and the perl
>program exitis with "Broken Pipe".  I have dummied up a file less
>than 380 characters which seems to go through, although you can't
>hardly get a good rtl file in less than 380 characters.

If you seem able to send and plot short files, I *think* you're
mostly talking OK.

I've only two rather simple things to try:
  1) try sending \r\n to the printer instead of just \n; the HP
     *might* just want the CR as well.
  2) try sleeping between sending blocks of data to the printer;
     perhaps the JetDirect card can't handle quite so high a
     data flow.

Fest3er


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

Date: Wed, 29 Jul 1998 18:11:51 -0500
From: David Nicol <david@kasey.umkc.edu>
To: persicom@my-dejanews.com
Subject: reinterpolation without eval; weak eval; qqq/STRING/ ?
Message-Id: <35BFAC37.A1BF1A@kasey.umkc.edu>

Hello

I'm sending some form-letter e-mail based on templates read in
from a database.

So I've got this template, $Template and a pile of local variables
that fit into it, and I'm interpolating the local variables into the
template like so

send_email_function(eval $Template)


I am worries about my templates getting tainted.

Is there a scheme triple quote kind of operator that can explicitly
interpolate a scalar, following the double-quote rules? 
qq/$Template/ isn't what I want, it will return

To: $RecipAddress
Subject: $Subject

Dear $Recipient

In regards to the $Issue 

et cetera, et cetera

Or how do I cripple eval so it won't do anything but interpolation,
even if the string in there is all full of semicolons and such?

Would eval ( qw/$Template/ ) is flawed by the same reasoning.


______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
               "Is the envelope half empty or half full?"


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

Date: Wed, 29 Jul 1998 20:34:16 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: removing accented characters from a string
Message-Id: <1dcy2xj.4vnwznav3m0bN@bay1-90.quincy.ziplink.net>

[posted and mailed]

<ultrasparc@my-dejanews.com> wrote:

> How could I have the "tr" expression replace any accented letter with an
> English letter?

The same way you use tr to replace any other character with another
character.  Put the character(s) you want to replace on the left, and
the character(s) you want them replaced with on the right.  :-)

tr/q/n/;

You could also specify the accented letters by ASCII value:

tr/\x96/n/;

-- 
 _ / '  _      /         - 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: 29 Jul 1998 17:05:21 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: sytem( ) calls in CGI scripts
Message-Id: <obiukggvoe.fsf@alder.dev.tivoli.com>



bday@cbr.eng.sun.com (Brian Day) writes:
> I was wondering if anybody could explain why system() calls are not working
> in my CGI scripts.  Everything else works fine, but when I try to use:

they're working, just not as you'd expect...

> system("cd /home/brandond/expl_db");
> system("ls -1 explorer* > temp");

If you look in the directory where the perl script is called I think
you'll find the temp file there.

Try the following:

system("cd /home/brandond/expl_db");
system("pwd > /tmp/pwd_2sys.txt");

and

system("cd /home/brandond/expl_db ; pwd > /tmp/pwd_1sys.txt");

and 

chdir ("/home/brandond/expl_db") or die "Could not cd to /home/brandond/expl_db, stopped";
system("pwd > /tmp/pwd_chdir.txt");

and examine the results.


(The reason for this is that when you make a system call, a seperate
process is created, that process cd's to the directory you want, then
exits, but the calling process never changed directories.)

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: Wed, 29 Jul 1998 20:34:17 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <1dcy3et.wxmmcqvp1ox5N@bay1-90.quincy.ziplink.net>

John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:

> In article <1dcwkn3.14voao11uuryvbN@bay1-205.quincy.ziplink.net>,
> Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
> >John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
> >
> >> I see nothing related to perl in the string 02-29-100. If I am your
> >> pointy haired boss and you hand me a report with that date in it, I
> >> have no way of knowing that you programmed in perl. "Dates will be the
> >> output of the 'localtime' perl funtion" is not how any company I know
> >> of standardizes its dates. "Dates will be expressed as the last two
> >> digits of the year" is.
> >
> >Then add 1900 to the year when you print the report.  Duh.  It's not
> >Perl's fault if you don't know how to program.
> 
> I'm sorry you didn't follow the context of the discussion. I am not
> printing the report. I am not the one programming this example. I am
> pointing out that 02-29-100 is not an unambiguous way of representing
> the date. Period. 

I'm sorry you didn't follow the context of this discussion.

02-29-100 was given as an example of the values you get from Perl's
localtime function.  In that context, 02-29-100 *is* unambiguous.

> >You really do argue about the stupidest things.
> 
> Then you see some perl-related content in the string 02-29-100, and you
> can tell just by looking at it that it is the output of 'localtime'?  Or
> you just didn't bother reading what you replied to?

No, I see some Perl related content in the title of this newsgroup.

And I can tell by the message in which the text originally appeared that
it was the output of localtime.

I have followed this entire thread, starting with a user who wanted to
know why localtime returned a year of '100' instead of '00' in the year
2000.  Apparently, you didn't bother reading what you replied to.

-- 
 _ / '  _      /         - 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: Wed, 29 Jul 1998 17:03:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Year 2000
Message-Id: <386op6.uh3.ln@localhost>

joe (jsteorts@csc.com) wrote:

: I was wondering about Perl and the Year 2000.


   I was wondering what you found when you searched the documentation
   that came with perl for the string '2000'?


   I was wondering what you thought of the dozens of other threads
   on this subject when you did a dejanews search?


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


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

Date: 29 Jul 1998 23:10:14 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: Year 2000
Message-Id: <6poa4m$npj$1@news.ycc.yale.edu>

In article <6pnu08$hvj$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>What exactly are you asking here?
>What do you think `year 2000 compliance' is?

It's the computer industry's version of Proctor & Gamble's venerable "New
and Improved!"

Put it on the outside of your box and people will get a warm and fuzzy
feeling and buy your product. Even if it's a paint program or a package of
blank floppy disks.

miguel


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

Date: 29 Jul 1998 23:13:12 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Year 2000
Message-Id: <6poaa8$ada$3@news.iastate.edu>

joe (jsteorts@csc.com) wrote:
: I was wondering about Perl and the Year 2000.

: Is Perl Version 5.004 year 2000 compliant?

: If not, are there plans for a Year 2000 compliant release?

: Are the LWP packages (HTML Parser, libnet, data dumper, MIME, MD5, and
: libwww) year 2000 compliant?


I sure hope they're not paying NASA employees too much these days.


--

__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
            - Thomas Pynchon



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

Date: 30 Jul 1998 00:09:10 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Year 2000
Message-Id: <6podj6$rip@mozo.cc.purdue.edu>

"joe" <jsteorts@csc.com> writes:

}I was wondering about Perl and the Year 2000.
}Is Perl Version 5.004 year 2000 compliant?
}If not, are there plans for a Year 2000 compliant release?

Go to www.perl.com, or use dejanews.  You'll discover that the answer
is yes.  Also, you lose karma for not doing that first.  (This
question has been asked pretty much to death.)

}Are the LWP packages (HTML Parser, libnet, data dumper, MIME, MD5, and
}libwww) year 2000 compliant?

I have not seen this question asked, although sometimes I do nod off
during these Y2K discussions.  Perl itself does not prevent the
writing of modules with Y2k bugs in them.  "Has any effort been made
to check CPAN modules for Y2k bugs?" may indeed be an interesting
question.  I do not know the answer, but I'd suggest checking dejanews
again.


-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Wed, 29 Jul 1998 20:39:47 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Year 2000
Message-Id: <fl_aggie-2907982039470001@aggie.coaps.fsu.edu>

In article <386op6.uh3.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

+ joe (jsteorts@csc.com) wrote:

+ : I was wondering about Perl and the Year 2000.

+    I was wondering what you found when you searched the documentation
+    that came with perl for the string '2000'?

+    I was wondering what you thought of the dozens of other threads
+    on this subject when you did a dejanews search?

I was wondering if he bothered to read the newsgroup before posting?

James


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

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

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