[11518] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5118 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 12 10:07:43 1999

Date: Fri, 12 Mar 99 07:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 12 Mar 1999     Volume: 8 Number: 5118

Today's topics:
    Re: 
    Re: 
    Re: 
    Re: Accessing MSACCESS Database on NT from UNIX. ruxfounder@my-dejanews.com
    Re: Are negative array indeces allowed? (Sam Holden)
    Re: Are negative array indeces allowed? <john.chambers@gte.com>
        Can Perl do this? <soclc@hkusua.hku.hk>
    Re: Can't Increment Counter in FILE Using http:// (Tad McClellan)
    Re: CGI.pm - parameter count? k_mcdermott@my-dejanews.com
        Dates <jcorbin@apci.net>
    Re: debugger mystery... <john.chambers@gte.com>
    Re: Delete Text Block Between a pair of Parenthesis (Tad McClellan)
    Re: Elegant remote execution of Perl-scripts? <Jochen.Stenzel.gp@icn.siemens.de>
    Re: FAQ 3.21: How can I hide the source for my Perl pro (John Moreno)
        Help converting perl website to a Windows CD (Adam)
    Re: Help converting perl website to a Windows CD (Jonathan Stowe)
        Is there a way to supress spaces in a format? <mymail@nospam.com>
    Re: Is there a way to supress spaces in a format? <rick.delaney@home.com>
    Re: Is there a way to supress spaces in a format? <john.chambers@gte.com>
        Learn the truth - In Dear Recruiter we establish exactl <computer_consultant7@my-dejanews.com>
    Re: make exe from perl skript <raming@ewh.uni-hannover.de>
    Re: Module to find duplicate files? (Tad McClellan)
    Re: Package Usage (Jonathan Stowe)
        Perl, IIS, writing to network drives ancics@cibc.ca
    Re: Problems writing data to files <cobalt@dircon.co.uk>
    Re: Problems writing data to files (Jonathan Stowe)
    Re: regexp gurus help! Parsing HTML (Randal L. Schwartz)
    Re: use diagnostics problem? <horizon@internetexpress.com.au>
    Re: write/format bypasses tie? <rick.delaney@home.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 11 Mar 1999 18:55:38 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 
Message-Id: <MPG.115222079b3fcecc989729@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <bingdo19-ya02408000R1103991044570001@news.alt.net> on Thu, 
11 Mar 1999 10:44:57 -0400, Bob Langdon <bingdo19@earthlink.net> says...
> I'm new to perl, so I wrote a short script I thought I couldn't screw up,
> but it won't work.

That's because it doesn't do anything!

> I want to remove the ".html" from all of the files in a directory called "bbs"
> 
> the script I tried is:
> 
> #!/usr/bin/perl

Add the '-w' flag to this line, and 'use strict;' as the next line.  Get 
into this habit now and you'll never regret it.

> opendir(BBS, '/home/gigs/public_html/bbs');

How do you know that this succeeded?  Always check the results of a 
system call, especially 'open' or 'opendir'.

  my $dir = '/home/gigs/public_html/bbs';
  opendir BBS, $dir or die "Couldn't open $dir. $!\n";

> @allfiles = readdir(BBS);
> foreach $file(@allfiles){

You could simply put the list directly into the foreach loop:

  foreach my $file (readdir BBS) {

> $file =~ 's/(.*)\.html/$1/g';

The real problem is here (and this is the only 'stupid mistake' you 
made).  You tried to change the value of the temporary variable $file 
(and wouldn't succeed, because the right-hand side is a string, not a 
substitution operator), but that wouldn't change the name of the file in 
the file system, would it?  You need to ask the OS to do that.

Something like the following:

  if ($file =~ /(.*)\.html$/) {
     rename "$dir/$file", "$dir/$1"
         or die "Couldn't rename $dir/$file. $!\n";
  }

> }
> exit
> 
> Okay, what stupid mistake(s) did I make?

Now you know.  :-)

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 11 Mar 1999 17:03:22 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: 
Message-Id: <aje9c7.g99.ln@magna.metronet.com>

Tad McClellan (tadmc@metronet.com) wrote:
: Bob Langdon (bingdo19@earthlink.net) wrote:

: : I want to remove the ".html" from all of the files in a directory called "bbs"

: : the script I tried is:
: : #!/usr/bin/perl
: : opendir(BBS, '/home/gigs/public_html/bbs');

:       $newname = $file;
:       $newname =~ s/(.*)\.html$/$1/g;
:       rename( $file, $newname) || die "could not move '$file'  $!";


   Doh!

   That should have been:

   rename( "/home/gigs/public_html/bbs/$file", 
           "/home/gigs/public_html/bbs/$newname") || die ...


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


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

Date: Fri, 12 Mar 1999 09:49:51 -0400
From: bingdo19@earthlink.net (Bob Langdon)
Subject: Re: 
Message-Id: <bingdo19-ya02408000R1203990949510001@news.alt.net>

Oh no! More sh*t to memorize!

What is -T?

And why use it only in CGI?

--Bob Langdon
bingdo19@earthlink.net


In article <slrn7eh2i9.k2q.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:

> >#!/usr/bin/perl -w
> >use strict;
> 
> Except for CGI scripts of course which really should have a T in there 
> somewhere...


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

Date: Fri, 12 Mar 1999 13:07:25 GMT
From: ruxfounder@my-dejanews.com
Subject: Re: Accessing MSACCESS Database on NT from UNIX.
Message-Id: <7cb3i8$78u$1@nnrp1.dejanews.com>

As I know the only proved way to do it is to use
DBD::Proxy module on both boxes with DBD::ODBC on Win32

Search DBI related stf on http://www.hermetica.com/
and try to ask (or search) DBI mailing list...

-Dima.

In article <36E619EA.E44E1F1A@deshaw.com>,
  omkumar <omkumar@deshaw.com> wrote:
>  I need to access an MSACCESS database on an NT machines from a Solaris
> system using PERL. Can anyone suggest the best way to do this? Can I use
> DBD::DBI modules for that? It would be great if someone gives more
> details about this.
>
> Thanks in advance
> Omkumar
>
>

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


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

Date: 12 Mar 1999 13:09:37 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Are negative array indeces allowed?
Message-Id: <slrn7ei4gh.1nq.sholden@pgrad.cs.usyd.edu.au>

On 12 Mar 1999 12:43:27 +0100, Alex Farber <eedalf@eed.ericsson.se> wrote:
>Hi,
>
>I have just discovered that perl -e '@x = qw (a b c); print $x[-3]'
>prints "a" on my Solaris workstation (perl 5.004_04). So, is a
>negative array index allowed? Amazing, I haven't ever read about it
>in the 5 perl books I have or in "perldoc perldata"... When was it
>introduced? Can I rely on it now?

Did you read the first paragraph of that perldata documentation you
claimed you did?

I doubt it. It gives you your answer in simple English.

Well it does in 5.005 under linux, and 5.002 under Solaris. So I assume
it didn't disappear in between.

-- 
Sam

You can write Perl programs that resemble sed, or awk, or C, or Lisp, or
Python. This is Officially Okay in Perl culture.
	--Larry Wall


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

Date: Fri, 12 Mar 1999 09:24:16 -0500
From: John Chambers <john.chambers@gte.com>
Subject: Re: Are negative array indeces allowed?
Message-Id: <36E92390.308C6E84@gte.com>

Sam Holden wrote:
> 
> On 12 Mar 1999 12:43:27 +0100, Alex Farber <eedalf@eed.ericsson.se> wrote:
> >Hi,
> >
> >I have just discovered that perl -e '@x = qw (a b c); print $x[-3]'
> >prints "a" on my Solaris workstation (perl 5.004_04). So, is a
> >negative array index allowed? Amazing, I haven't ever read about it
> >in the 5 perl books I have or in "perldoc perldata"... When was it
> >introduced? Can I rely on it now?
> 
> Did you read the first paragraph of that perldata documentation you
> claimed you did?
> 
> I doubt it. It gives you your answer in simple English.
> 
> Well it does in 5.005 under linux, and 5.002 under Solaris. So I assume
> it didn't disappear in between.

Jeez; it'd have been a lot less typing to simply answer the question:

	No.

(Perhaps it would also help the supplicant^Wposter to observe that
negative subscripts work just fine with hashes; aka associative
arrays.  Of course, these beasties don't behave quite the same
as plain vector-style arrays, and performance isn't as good. But
in many programs, you can get the desired effect by simply using
{} rather than [] around the array subscripts.)


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

Date: Fri, 12 Mar 1999 21:03:50 +0800
From: Charles So <soclc@hkusua.hku.hk>
Subject: Can Perl do this?
Message-Id: <36E910B6.E223DF1E@hkusua.hku.hk>

Gentlemen,

Can a Unix server remotely execute a Windows 95 program (with command
line parameters) residing over a TCP network with Perl?


Any hints on how to do this, with what programs (on both the server and
client side) will be greatly appreicated.

Thanks!
Charles



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

Date: Fri, 12 Mar 1999 03:08:17 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <h1iac7.3j9.ln@magna.metronet.com>

George Crissman (strads@tmisnet.com) wrote:
: On Thu, 11 Mar 1999 03:19:14 -0500,  (Tad McClellan) wrote:
: >George Crissman (strads@tmisnet.com) wrote:
: >: The good news:  it WORKS in telnet mode based in the
: >:         cgi-bin directory.
: >: The bad news:  it DOESN'T work in http:// mode from my browser.
: >                    ^^^^^^^^^^^^
: >   We cannot help much if you don't decribe what that means.

: You're right.  I'm embarrassed that I asked the question the way I
: did.  What I meant to say was "the counter doesn't increment
: when the cgi program is called from a browser."

: >   Get any messages?

: No.


    Hmmm. Then I don't know what the problem could be.

    The "usual problem" is that the current directory is 
    different for CGI programs, so you need to give the
    absolute path to the file.

    But that can't be it here, because you would be getting
    messages from your die()s in your server error logs, but
    you say you aren't getting any...


: >   You have a race condition here.

: Now, THAT I understand.  


   I'm afraid that you don't really   :-)


: It would seem that I'm attempting to
: re-open the file for write access before it has had a chance to
: close for read access (maybe due to system latency).  Is that 
: a correct explanation?


   No.

   If you try to open a filehandle that is already open, perl
   will automatically close it for you before doing the open().

   I tried to explain it below. Guess I'll try again...


: >   syscount.txt may be created by another instance of your program
: >   right here, before this instance of your program opens the file.
: >
: >   Better to just open it, then check to see if it has any content.


   In a multitasking environment, your program can be suspended
   (stopped) at any time, then restarted later after some other
   programs have executed.

   If the "other programs" include an instance of this same program,
   then _it_ might create the file when _this_ copy of the program
   has already decided that the file does not exist.

   You will end up with *both* programs setting the count to
   the initial value. (you will "lose" one serial number)

   The line:

      $num = <FH> || 0;

   in the FAQ handles this for you, without the race introduced
   by the -e file test.

   If the file had some contents, then $num is set to that.

   If the file had no contents, then $num is set to zero.


: Nice idea ... but I need to use the number as part of program
                ^^^
: output, and I'd like to save the incremented number back to
: the file so it's ready for use next time.


   My suggestion and your desire do not conflict.

   You can do it as I suggested (or, better yet, as in the FAQ)
   and still do what you say above.

   I don't follow the "but" part there...


: >   If you are going to use this code in a multitasking environment
: >   (CGI is one of those), then you need to do file locking to
: >   avoid corrupting the data.
: >
: >   See the Perl FAQ, part 5:
: >
: >      "How can I lock a file?"
: >
: >      "What can't I just open(FH, ">file.lock")?"
: >
: >      "I still don't get locking.  I just want to increment the 
: >       number in the file.  How can I do this?"


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


   You should never quote signatures in followups.


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


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

Date: Fri, 12 Mar 1999 12:15:27 GMT
From: k_mcdermott@my-dejanews.com
Subject: Re: CGI.pm - parameter count?
Message-Id: <7cb0go$4u4$1@nnrp1.dejanews.com>

Thanks for your help Philip,

I am new to this Perl stuff and I haven't learned all the bits yet...

Thanks again

Kevin

In article <36E8DD04.A226B90B@datenrevision.de>,
  Philip Newton <Philip.Newton@datenrevision.de> wrote:
> k_mcdermott@my-dejanews.com wrote:
> >
> > I had thought that the number of parameters would be useful since the
creator,
> > only has one parameter and the form processor has many, but I can't get
> > the number of parameters out?
>
> Well, you said above that you are using CGI.pm -- a quick look at its
> documentation shows that there is a method param, which you can call
> either as $query->param or just as param (depending on whether you're
> using the object-oriented or functional interface). This gives you a
> list with the names of the parameters. If you take this in scalar
> context, it gives you the number of parameters.
>
> Example:
>
>     @names = $query->param;
>     $numparams = @names;
>
> (Possibly this also works:
>
>     $numparams = scalar $query->param;
>
> It depends on whether param gives something else back depending on
> whether it was called in scalar or list context.)
>
> Cheers,
> Philip
>

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


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

Date: Fri, 12 Mar 1999 08:14:27 -0600
From: "John Corbin" <jcorbin@apci.net>
Subject: Dates
Message-Id: <36e91f59.0@queeg.apci.net>

Can someone gimme a pointer on how to subtract a date from current date?


--
John
jcorbin@apci.net







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

Date: Fri, 12 Mar 1999 09:13:51 -0500
From: John Chambers <john.chambers@gte.com>
Subject: Re: debugger mystery...
Message-Id: <36E9211F.CEE6B528@gte.com>

Matthew O. Persico wrote:
> 
> John Chambers wrote:
> >
> > James Tolley wrote:
> > >
> > > Hello all,
> > >
> > > The debugger displays some of my code out of order. It also seems to
> > > skip over some while loops.
> > >
> > > Has anyone sen anything like this? What's causing it?
> >
> > Yeah; I noticed that after I first picked up 5.004 many moons
> > ago.  It doesn't happen all that often, but when it does, it
> > pretty much makes the debugger unusable.  I've since seen it
> > on any number of different machines, including SunOS, Digital
> > Unix (OSF1), and linux, so it's definitely a new feature.  I
> > asked a few questions and got no replies at all.
> 
> This mostly happens with loops. You hit the loop top and the next step
> takes you to the first executable line past the loop bottom. It's
> annoying, but it is not harmful. If you really have a problem with it,
> report it as a bug. The docs that come with perl tell you how. Try
> perldoc perlbug.


Not harmful? It makes the debugging session utterly worthless
and a waste of time.  When it happens, I have to abandon the
debugger and start adding print statements.  If this isn't
harmful (to the task of getting the code working), then what
would qualify?

I've gone through the perlbug steps of reporting it, but as
far as I can tell, there was no evidence that anyone ever got
the message.  In fact, there was no conclusive evidence that
any message ever left the machine that I was running on. How
might one verify that a message has actually been sent?  An
exit status of zero isn't exactly proof that the program did
what you wanted, y'know.


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

Date: Thu, 11 Mar 1999 17:09:52 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Delete Text Block Between a pair of Parenthesis
Message-Id: <gve9c7.g99.ln@magna.metronet.com>

kqchung@my-dejanews.com wrote:

[ snip deleting text between balanced parenthesis ]

: I am sorry if this question had been asked in the past.  If
: it is could you give me a pointer to that article.


   Perl FAQ, part 6:

      "Can I use Perl regular expressions to match balanced text?"


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


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

Date: Fri, 12 Mar 1999 14:14:31 +0100
From: "Hr. Jochen Stenzel" <Jochen.Stenzel.gp@icn.siemens.de>
To: "G.B. Woeste" <GWoeste@yahoo.com>
Subject: Re: Elegant remote execution of Perl-scripts?
Message-Id: <36E91337.64926E21@icn.siemens.de>

"G.B. Woeste" wrote:

> two questions:
>
> how can I execute a Perl-script, which is initially located on
> computer A on another computer B?
>
> How can I transmit values from computer A as commman-line arguments to a
> (then executed) Perl-script on computer B?
>
> Both computers are working under Unix and are connected (via TCP/IP).
>
> The problem for me is, that I don't know much about Networking , Sockets
> and so on.
>
> Does anyone have some example code? That would be very helpfull!

I'm currently working on a script that performs exactly this task. It's
still an early draft (one week old) but already works successfully with
certain scripts of mine. This is no traditional client/server solution, the
only precondition on the target machine is a perl of version 5.x. Output
data are redirected to the caller machine. Input data access CAN be
redirected from the caller machine to the script running remotely
(depending on its path). Script options are passed transparently. The
target script has NOT to be prepared for this remote execution. All
communication is done via STDIN, STDOUT and STDERR, so that the
communication will be guarded automatically if you use ssh.

Example: I named my script "rsc", so if you have a script "a" on your host
A that should run on host B, you just can say:

A> rsc [<rsc options>] -- B a [options for a]

That's all.

It will NOT work if the target script already ties filehandles or overrides
file access builtin functions (open(), close() etc.). Possibly this list
has to be extended (it's beta code now).

If this script is of interest even in its early, scanty documented state, I
could publish it on CPAN.

Greetings

                            Jochen






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

Date: Fri, 12 Mar 1999 09:20:34 -0500
From: planb@newsreaders.com (John Moreno)
Subject: Re: FAQ 3.21: How can I hide the source for my Perl program?
Message-Id: <1dojq8f.1fcpg52f2lvzrN@roxboro0-0016.dyn.interpath.net>

Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:

> John Moreno <planb@newsreaders.com> wrote:
> 
> > Tom Christiansen <perlfaq-suggestions@perl.com> wrote:
> > 
> > >     Security through obscurity, the name for hiding your bugs instead of
> > >     fixing them, is little security indeed.
> > 
> > This isn't true. All security is through obscurity -- it's always about
> > limiting access to something.
> 
> Not at all.  Limiting access is not the same as obscurity.

Limiting access to information is.
 
> For example, you will find very few banks masquerading as fast food
> restaurants.  If that were the only security measure a bank took, they
> would be easy pickings for anyone who knew where to find them.  That
> would be security through obscurity.

And they don't go around handing out the daily security codes for the
armored cars, or any of the other information which would allow one to
walk in off the street and walk out with large sums of money without
shooting someone.

> Instead, banks have guards, cameras, vaults, alarms, etc.  And even
> though everybody knows about most of the security measures, it's not
> easy to rob a bank.

Actually, if your willing to shoot someone it is.

-- 
John Moreno


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

Date: Fri, 12 Mar 1999 14:02:53 GMT
From: horseyride@hotmail.com (Adam)
Subject: Help converting perl website to a Windows CD
Message-Id: <36e6abba.13632392@news.bobcat.dynip.com>

I have a perl program that read in a template and generates an HTML
page on the fly incorporating a specified image. 

It takes the form /cgi-bin/process.pl?item=300

I have about 15000 images. Now the customer wants to make a CD of his
web site. I tried using PERL2EXE to make an executable but ---

1. Can't figure out get the executable to read the ?item=300 part
2. Output seems directed to a windows dos box, not the browser
3. How would I call it from the browser anyway

Any overall ideas???


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

Date: Fri, 12 Mar 1999 14:41:11 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Help converting perl website to a Windows CD
Message-Id: <36e92706.1406340@news.dircon.co.uk>

On Fri, 12 Mar 1999 14:02:53 GMT, horseyride@hotmail.com (Adam) wrote:

>I have a perl program that read in a template and generates an HTML
>page on the fly incorporating a specified image. 
>
>It takes the form /cgi-bin/process.pl?item=300
>
>I have about 15000 images. Now the customer wants to make a CD of his
>web site. I tried using PERL2EXE to make an executable but ---
>
>1. Can't figure out get the executable to read the ?item=300 part
>2. Output seems directed to a windows dos box, not the browser
>3. How would I call it from the browser anyway
>
>Any overall ideas???


Unless you incorporate an HTTP server on your distribution then you
wont be able to do it - however this ihas nothing to do with Perl perl
se - Your Perl programs work.  You might ask in a group that has CGI
in the name ....

/J\


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

Date: Fri, 12 Mar 1999 08:28:54 -0500
From: JPAH-FLA <mymail@nospam.com>
Subject: Is there a way to supress spaces in a format?
Message-Id: <36E91696.3C6C5622@nospam.com>

Thank-You for your assistance with my previous Format question.  I'm
beginning to think Mr. Curtis is right and I should abandon formats
entirely for HTML rendering. They seemed to work well at first, but now
I'm starting to struggle with them.

I have a tag that I want to read something like

  <a href=myprog.cgi?123+c>
  or
  <a href=myprog.cgi?1234+c>

but with this format
  <a href=myprog.cgi?@|||+c>

I end up with
  <a href=myprog.cgi?123 +c>
                                     ^ space

an extra space which causes the browser to interpret +c as the next tag
parameter instead of being part of the href. Is there a way with a
format to force trailing space supression? In Camel p122 they discuss
character fill, but I don't see any details on supression.

Cheers, and again thanks for the tips & assistance.





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

Date: Fri, 12 Mar 1999 14:03:22 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Is there a way to supress spaces in a format?
Message-Id: <36E92094.17B7C33E@home.com>

JPAH-FLA wrote:
> 
> Thank-You for your assistance with my previous Format question.  I'm
> beginning to think Mr. Curtis is right and I should abandon formats
> entirely for HTML rendering.

Probably a good idea.

>  They seemed to work well at first, but now I'm starting to struggle 
> with them.
> I have a tag that I want to read something like
> 
>   <a href=myprog.cgi?123+c>
>   or
>   <a href=myprog.cgi?1234+c>
> 
> but with this format
>   <a href=myprog.cgi?@|||+c>
> 
> I end up with
>   <a href=myprog.cgi?123 +c>
>                                      ^ space

format was never designed for this.  One way to get around this is to
append the +c into the variable you're using.

format HTML =
<a href=myprog.cgi?@<<<<< >
                   $foo
 .

$foo = 123;
$foo .= '+c';
write;

I'm guessing that spaces between +c and > don't matter.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 12 Mar 1999 09:32:02 -0500
From: John Chambers <john.chambers@gte.com>
Subject: Re: Is there a way to supress spaces in a format?
Message-Id: <36E92562.DE323FC@gte.com>

JPAH-FLA wrote:
 ...
> but with this format
>   <a href=myprog.cgi?@|||+c>
> 
> I end up with
>   <a href=myprog.cgi?123 +c>
>                                      ^ space
> 
> an extra space which causes the browser to interpret +c as the next tag
> parameter instead of being part of the href. Is there a way with a
> format to force trailing space supression? In Camel p122 they discuss
> character fill, but I don't see any details on supression.

You'll probably be much happier if you don't try to use formats for
this sort of task.  Formats are basically designed for producing the
sort of columnar output that some programs (and people) like.  But
HTML doesn't much care about such formatting, and you'll waste far
too much time trying to solve trivia like this.

You'll probably find it much easier to just use double-quoted strings
in such cases.  They don't generate any spurious characters, and
variables tend to get interpolated as a minimal character string.
If you want padding of some sort to a fixed or minimal width, look
at the sprintf function.  It can be used to do things very similar
to formats, but wouldn't generate the above space unless you have
an explicit % format to force it.


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

Date: Fri, 12 Mar 1999 14:44:45 GMT
From: QualifiedConsultant <computer_consultant7@my-dejanews.com>
Subject: Learn the truth - In Dear Recruiter we establish exactly what a recruiter does.
Message-Id: <7cb98q$cb3$1@nnrp1.dejanews.com>

This is the first in a series of documents I will be writing to educate the
computer consulting industry as a whole.

The answer to the question "establish exactly what a recruiter does" is
NOTHING.

*********************

Dear Recruiter,

I understand that you believe that you are accomplishing something in your day
to day work but I have to tell you that you have been fooled.

Who do you receive job positions from? A Human Resources worker at a company.
This same company hired that Human Resources person to find prospective
employees for their company. In essence this Human Resources person is not
doing the job they were hired to do. It seems like you are doing the "job"
that the Human Resources person is not doing themselves. Actually, you do not
have the skills to do the job that the Human Resources person should be
trained and was hired to do. Each company with it's own individual
requirements for each individual job opening. You cannot possibly have the
talent of all of the positions of all of the companies your firm "services".
Without this talent there is no way you could possibly make a knowledgeable
decision. So YOU are not doing the Human Resources persons job either.

So what do you do? Well, without that individual knowledge, you use what is
commonly referred to as "buzzwords". Wait, did I say you actually look for
words on resumes? Well, I surely didn't say that you would actually READ
THEM. (Not even before an interview with the consultant.) But I digress. What
really happened was a CONSULTANT built a program so that the resumes could be
searched by keywords. Keywords = "buzzwords" Makes it real hard to
find...anything. First - you really don't even know what you are looking for.
Next - you are trying to find out if a consultant is qualified for a job you
know nothing about. Is this actually working? Do you have the knowledge to
make these kind of decisions?

Are you doing the job of the consultant? No, you are not. Companies have many
ways to find prospective employees; and consultants "could" utilize those
resources to find CLIENTS. But that is not how it works. I have watched my
local newspaper go from between five and seven pages of computer consulting
job openings down to between one-half and one page of consulting firm "job
openings" in a three year span. Since the job of the human resource person is
not being filled by ANYONE, this is one of the reason companies no longer
advertise. They pick the phone up - call a recruiter - get a free lunch. You
getting the picture here? I bet some human resource employees have had more
paid lunches than the president of the their company.

Another reason is that consulting firms are just like real estate agencies.
The real estate workers drive around and look for houses for sale by owner
and try to talk the owners into paying them a large sum to do very little.
Same tactic - different field, only everybody in the real estate business is
doing a job. So when a company puts a computer consulting ad in the newspaper
they are swamped with calls from recruiters - sales people who want paid a
large sum while having no knowledge of how to accomplish the task. The human
resource person (who was hired to do this job) could very easily do their job
and contact the consultants and post ads in the paper and on the world wide
web. And if they were smart enough they would know how to find consultants
without having to take more of their companies money to pay you.

I can see where you feel like you have accomplished something. I know that if
I could actually do the "job" you do, with the computer CONSULTING mentality
you have, that I would feel great about myself to.

But really are you actually doing anything?

You may not like me but we are all entitled to our opinion and this is my
opinion.

CLIENTS AND COMPANY OWNERS: I charge between $35 and $50 to create MS Access
databases as an independent consultant through telecommuting. How much are the
consulting firms charging you? Please include your Human Resources employees
free lunch we both paid for.

I will except opinions from all QUALIFIED COMPUTER CONSULTANTS. Everyone else
will be ignored.

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


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

Date: Fri, 12 Mar 1999 13:17:43 +0100
From: Georg Raming <raming@ewh.uni-hannover.de>
Subject: Re: make exe from perl skript
Message-Id: <36E905E7.F0B3481D@ewh.uni-hannover.de>

Sorry, I just read something and assume 
"perl2exe" is the solution!

Georg


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

Date: Fri, 12 Mar 1999 03:12:07 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Module to find duplicate files?
Message-Id: <n8iac7.3j9.ln@magna.metronet.com>

Greg Ward (gward@cnri.reston.va.us) wrote:
: Philip Newton <Philip.Newton@datenrevision.de> wrote:
: > how would I go about finding duplicate files under a certain directory?
: > Is there a module to do that already? A quick glance through CPAN didn't
: > bring up anything which sounded as if it would work.

: Here's a script that does this.  It might take a few minutes to massage
: it into a module; most importantly, it should be changed to use the
: File::Compare module (standard with Perl 5.005) rather than exec'ing the
: Unix-specific "cmp" utility.  Left as an exercise for the reader.


   Except I think Philip meant to ask a different question.

   Judging by his code, I think he is trying to find duplicate
   *filenames*, not duplicate files as he said.

   Of course, he should expect to get what he specified, even
   if what he specified is not what he wants  :-)


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


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

Date: Fri, 12 Mar 1999 12:25:42 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Package Usage
Message-Id: <36e90565.12249677@news.dircon.co.uk>

On Fri, 12 Mar 1999 10:18:41 +0100, Mark <admin@asarian-host.org>
wrote:

>Hi,
>
>I am trying to use a module:
>
>use Net::SMTP;
>use strict;
>
>I put these lines at the tp of my program, but perl always complains with
>the message that the global variable SMTP needs explicit reference to a
>package. Then it aborts. Sigh. Do I need to include some sort of extra
>reference to the package in my program? Sorry to sound so ignorant, but I am
>new to this packages thingy.
>

The two lines above are not the ones that are cause of your problem  -
I think that you probably have a line like:

$SMTP = Net::SMTP->new('mailhost');

You have asked Perl to complain about this use of the variable $SMTP
with the use strict; pragma.

You can get over this in several ways:

my $SMTP =  <etc etc>  ; # make $SMTP a lexical

use vars qw($SMTP);  # predeclare to strict ..

$main::SMTP = <etc etc>  ; explicit package name ..


/J\


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

Date: Fri, 12 Mar 1999 14:38:45 GMT
From: ancics@cibc.ca
Subject: Perl, IIS, writing to network drives
Message-Id: <7cb8tj$c4d$1@nnrp1.dejanews.com>



I am attempting to use a script to write data submitted from a web form
to a shared network drive.  The permissions have been set to allow
anonymous Intranet users access to this drive.  Unfortunately, the
script fails to recognize the network when it is run from the web form
(NT 4.0, IIS 4.0).  I get an error: "Couldn't create file; No such file
or directory".  This script works correctly from the command prompt.
It will work from the command prompt and the web form if a local drive
is chosen instead of a network drive.

Is it possible to access a network drive when a script is executed from
a web server?  How is this accomplished?

Below, is a snippet of the code for reference.

# For local drive
# open (FEEDBACK, ">>c://subdir/ar$year-$yday.txt");

# For network drive
open (FEEDBACK,
">>\\\\servername\\sharename\\subdir\\ar$year-$yday.txt") || die
"Couldn't create file; $!\n";

print FEEDBACK "===Request - $month $mday,
19$year====================\n\n";

print FEEDBACK "Name: $FORM{UserName}\n";
print FEEDBACK "Department: $FORM{UserDept}\n";
print FEEDBACK "Location/Address: $FORM{UserLocation}\n";
print FEEDBACK "Phone Number: $FORM{UserPhone}\n";
print FEEDBACK "Email Address: $FORM{UserEmail}\n";

print FEEDBACK "Please send me the following items:\n";
print FEEDBACK "Items: $FORM{Items}\n";

close(FEEDBACK);


Thanks,

Sandra Ancic
ancics@cibc.ca

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


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

Date: Fri, 12 Mar 1999 13:43:31 -0000
From: "Paul Davies" <cobalt@dircon.co.uk>
Subject: Re: Problems writing data to files
Message-Id: <36e917d2.0@newsread3.dircon.co.uk>

The problem is NOT file priviliges as text data works just fine.

Paul Davies wrote in message <36e8fa1f.0@newsread3.dircon.co.uk>...
>I'm trying to write binary data from a variable to a file.
>
>The simple:
>
>print FILE <$var>; or print FILE $var is not working.
>
>Can someone please tell me how to do this?
>
>Thanks
>
>Paul
>
>
>
>




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

Date: Fri, 12 Mar 1999 14:31:48 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Problems writing data to files
Message-Id: <36e92509.896800@news.dircon.co.uk>

On Fri, 12 Mar 1999 13:43:31 -0000, "Paul Davies"
<cobalt@dircon.co.uk> wrote:

>The problem is NOT file priviliges as text data works just fine.
>
>Paul Davies wrote in message <36e8fa1f.0@newsread3.dircon.co.uk>...
>>I'm trying to write binary data from a variable to a file.
>>
>>The simple:
>>
>>print FILE <$var>; or print FILE $var is not working.
>>

I guess you are on some MS platform right ?

binmode() your filehandle -

perldoc -f binmode

/J\


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

Date: 12 Mar 1999 06:22:45 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: regexp gurus help! Parsing HTML
Message-Id: <m1lnh2vlca.fsf@halfdome.holdit.com>

>>>>> "Bart" == Bart Lateur <bart.lateur@skynet.be> writes:

Bart> mct@moviefone.com wrote:
>> I've killed two perfectly good evenings trying to do this:
>> 
>> Take this string:
>> 
>> <INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed">

Bart> Good example of what split() is bad in. You should use a real parser, or
Bart> a better quick fix. Here's a (rather succesful :-) attempt.

Except that it doesn't handle single-quoted attributes.  There's a version
in HTML::SimpleParse::parse_args that gets this correct.

Oops, now looking at the code, I see they *don't* get it correct.
Time to mail off a bug report to Ken. :)

print "Just another HTML parser author,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Fri, 12 Mar 1999 23:35:45 +1100
From: Mick <horizon@internetexpress.com.au>
To: Ronald J Kimball <rjk@linguist.dartmouth.edu>
Subject: Re: use diagnostics problem?
Message-Id: <36E90A21.5809691A@internetexpress.com.au>



Ronald J Kimball wrote:

> > which in my error log is
> > premature end of script headers.
>
> Are there more errors, or just that?  That's not a very helpful error,
> all it means is your script exited before it finished printing the
> headers.  But it doesn't say _why_ your script exited early.
>

That's why I'm trying to use diagnostics, my error_log only contains
premature end of script errors....Is the level of information given in the
error_log determined in the httpd.conf  (I'm using Apache by the way :) ) ?

I also comapared Carp.pm and diagnostics.pm for there format (To see if the
diagnostics.pm was different in any way, but, no, they are set out exactly
the same.)

Thanks for the reply,
Mick

> --
>  _ / '  _      /         - aka -          rjk@linguist.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."



--
----------------------------------------------------------------
HORIZON Software Solutions

Visit Site - http:www.deakin.edu.au/~bellears/horizon/index.html
e-mail     - mailto:horizon@internetexpress.com.au

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




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

Date: Fri, 12 Mar 1999 13:52:03 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: write/format bypasses tie?
Message-Id: <36E91DF2.6DCB3732@home.com>

[posted & mailed]

Sean McAfee wrote:
> 
> 
> I added a line 'syswrite(STDOUT, "foo", 3);' to my program above, and got
> this error message:
> 
> Can't locate object method "WRITE" via package "IO::Scalar" at pp line 4.
> 

Oh, yeah.  WRITE is for syswrite.  There is no method for write.  I
guess that's why perltie says tying filehandles is *partially*
implemented now.

> This surprises me.  I'd have thought that an official CPAN tied filehandle
> module would provide a complete tied filehandle implementation...

There's no law that says it should.  If it was in the standard
distribution then I would expect it too.

> 
> Anyway, it doesn't solve my problem.  I wrote a quick-n-dirty replacement
> for IO::Scalar, including a WRITE method, and the "format" output still
> went to my terminal.

That's because WRITE is for syswrite.  Sorry to steer you the wrong
way.  Or did you call it with syswrite? 

You could set up your own method that is similar to the swrite in
perlform, but that might be more trouble than it's worth.

At least you have something that works.  Sorry again for the misinfo.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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