[7606] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1232 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 27 07:13:38 1997

Date: Mon, 27 Oct 97 04:00:21 -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           Mon, 27 Oct 1997     Volume: 8 Number: 1232

Today's topics:
     Re: [Reposted due to Enlow UCE cancel]: Perl and MS Exc (Milivoj Ivkovic)
     Re: A little help, please. <mcguirk@indirect.com>
     Re: A little help, please. (brian d foy)
     Re: ARGV question <zenin@best.com>
     Re: BUG in WinPerl; OK in Unix Perl (Mike Heins)
     Re: BUG in WinPerl; OK in Unix Perl <jbokma@caiw.nl>
     Re: CGI tools <zenin@best.com>
     FOREACH command <webmaster@breitenbach.net>
     FYI: MacPerl, the MacPerl Pages, and an upcoming book (Rich Morin)
     Re: HELP: Registration with .htaccess ???? (YOSHIFUJI, Hideaki)
     NT Signal trapping ? (Stephen Spence)
     Re: other language for perl <jbokma@caiw.nl>
     Re: Perl 5 and here documents (Mike Stok)
     Re: Perl 5 and here documents <jbokma@caiw.nl>
     problem about win32::odbc <mysun@mbox2.singnet.com.sg>
     Re: Q: perl->NT ?? :( <rjk@coos.dartmouth.edu>
     Re: SOLVE and you'll be a GOD (in my eyes atleast) (brian d foy)
     Re: SOLVE and you'll be a GOD (in my eyes atleast) <jbokma@caiw.nl>
     tcp/ip connecttions <whs3@Ra.MsState.Edu>
     Re: the disappearing label problem... <seay@absyss.fr>
     Re: Your opinion on The Perl Journal (TPJ) ? <ajohnson@gpu.srv.ualberta.ca>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 26 Oct 1997 14:13:59 GMT
From: ivkovic@compuserve.com (Milivoj Ivkovic)
Subject: Re: [Reposted due to Enlow UCE cancel]: Perl and MS Excel
Message-Id: <34534c95.87427194@news.compuserve.com>

On Mon, 20 Oct 1997 17:27:36 -0400, Suhail Warsi <swarsi@nmpnet.net>
wrote:

>Does any one know if there is anything for perl that allows it to access
>MS Excel files?
In the perl distribution for Win32 I got from www.activeware.com,
there is an OLE module and 2 example scripts, called something like
excel1.pl and excel2.pl


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

Date: Mon, 27 Oct 1997 02:22:33 -0600
From: Dan McGuirk <mcguirk@indirect.com>
To: mcguirk@indirect.com
Subject: Re: A little help, please.
Message-Id: <877940192.3182@dejanews.com>

In article <dvmv26.kr.ln@localhost>,
  tadmc@flash.net (Tad McClellan) wrote:
> Jeremy Leigh ("jvleigh"@_nospam_kih.net) wrote:
>
> : This is a code fragment from the subroutine check_url.
> :
> : if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) {
>
> What I find suspicious in the given regex:
>
> 1) no anchor at beginning of string
>
>    m|^https?://([^/]*)$referer|i
>      ^
>      ^
>
> 2) no anchor at end of string
>
>    m|https?://([^/]*)$referer$|i
>                              ^
>                              ^
>
> 3) no slash required after matching char class
>
>    m|https?://([^/]*)/$referer$|i
>                      ^
>                      ^
>
> 4) not quoting the contents of $referer
>
>    m|https?://([^/]*)\Q$referer\E|i
>                      ^^        ^^
>
> So, this _might_ be better:
>
>    m|^https?://([^/]*)/\Q$referer\E$|i

It seems pretty clear that the original regexp is checking the
HTTP_REFERER field to make sure that the web page that's calling the
script is on the intended site.  (E.g., your site is "foo.com", which is
the value of $referer, and you're making sure the URL that's referring to
this script is something like "http://blah.foo.com/directory/page.html".)
 If this is true then changes #2 and #3 will both break the code.

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


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

Date: Mon, 27 Oct 1997 12:08:09 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: A little help, please.
Message-Id: <comdog-2710971208090001@netnews.worldnet.att.net>

In article <877940192.3182@dejanews.com>, Dan McGuirk
<mcguirk@indirect.com> wrote:

> In article <dvmv26.kr.ln@localhost>,
>   tadmc@flash.net (Tad McClellan) wrote:
> > Jeremy Leigh ("jvleigh"@_nospam_kih.net) wrote:

> > : if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) {

> > 2) no anchor at end of string
> >    m|https?://([^/]*)$referer$|i

> > 3) no slash required after matching char class
> >    m|https?://([^/]*)/$referer$|i

 
> It seems pretty clear that the original regexp is checking the
> HTTP_REFERER field to make sure that the web page that's calling the
> script is on the intended site.  (E.g., your site is "foo.com", which is
> the value of $referer, and you're making sure the URL that's referring to
> this script is something like "http://blah.foo.com/directory/page.html".)
>  If this is true then changes #2 and #3 will both break the code.

the code is fundamentally broken anyway.  checking the referrer for
anything other than data collection is a waste of time.  this ranks
pretty closely to trying to validate email addresses, which is also
a worthless pursuit.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 27 Oct 1997 10:06:27 GMT
From: Zenin <zenin@best.com>
Subject: Re: ARGV question
Message-Id: <631p33$f26$1@nntp2.ba.best.com>

Lloyd Zusman <ljz@asfast.com> wrote:
> On 26 Oct 1997 05:42:19 GMT, Zenin <zenin@best.com> wrote:
	>snip<
> I'm in wholehearted agreement.
	Thanks.

> Just because a programming construct
> is redundant doesn't mean that it shouldn't be used.  Given the fact
> that other people might some day have to maintain the code I write, I
> try to use certain constructs to help clarify the intent of what I'm
> doing.
	Exactly. -However half the reason is that I don't want to have to
	try and remember what I was doing when I read the code again in
	6 months, nor have to answer such questions from others trying
	to read it.

> I also tend to do this with other Perl constructs.
	Ditto.

> For example, the
> following two conditionals are equivalent in Perl, but I usually
> prefer to use the second one to help it be more clear to people as to
> whether 'func' will actually get called:

	Hmm...

> 1.   open(F, "<$file") or func($a, $b, $c);
> 2.   unless (open(F, "<$file")) {
>         func($a, $b, $c);
>      }
> The use of an explicit "<" in the above 'open' statements is yet another
> example of this.

	Hmm...this for me is overboard.  For me, if it easily reads like
	English and looks cleaner, I find it easier to read.  Eg, I'd
	use a _much_ barer statement for your example:

		open F, $file
			or func $a, $b, $c;

	For me, the extra quoting (the "<$file" instead of just $file) and
	the extra parens just make the statement much harder to read.  When
	spread across two likes as I show above, IMHO makes it both cleaner
	code, and easier to read/maintain.  But that's just me, YMMV. 
	Remember though, that the _only_ reason for the added or, and, etc
	low precedence operators was allow the calling of functions without
	the use of parens.

> Some of you may have noticed that I didn't mention run-time
> efficiency, and this is deliberate. In most cases, I don't consider
> the cost of a the machine cycles saved by using a more obscure Perl
> construct to be able to offset the cost of paying someone to decipher
> this code some time in the future.

	I find that Perl's flexibility allows for the use of the faster
	algorithm, while still being easy to read/maintain.

-- 
-Zenin (zenin@best.com)
 The Bawdy Caste (San Jose, CA)       http://www.netmagic.net/~dmcgrath/bawdy/
 Barely Legal   (Berzerkly, CA)                    http://www.barelylegal.org/
 Zenin's Rocky Archive (Moving soon!)              http://www.best.com/~zenin/


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

Date: 27 Oct 1997 02:15:46 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: BUG in WinPerl; OK in Unix Perl
Message-Id: <630tgi$8nl$1@vixen.cso.uiuc.edu>

Pierre Fortin (pfortin@cisco.com) wrote:
: There is a bug in WinPerl wherein a file which contains 0x1A can't be
: read past that point...

It is not a bug, as are not 90% of the things so labeled on
the subject line in this group....

: 
: I've included a script to illustrate the problem...  This works fine on
: a Unix system.
: 
: Pierre
: 
: 
: #!/usr/local/bin/perl5
: #
: # 'WinPerlBug.pl'
: #
: # BUG: Files containing 0x1A cannot be processed by WinPerl.
: #      This works OK on Unix version.
: #
: open BUGFILE1, '>Bugfile1';
: writefile(BUGFILE1,0,256);  # includes 0x1A
: close BUGFILE1;
: 
: open BUGFILE2, '>Bugfile2';
: writefile(BUGFILE2,32,256);
: close BUGFILE2;
: 
: open THIS_SCRIPT, '<WinPerlBug.pl';  # excludes 0x1A
: open BUGFILE1, '<Bugfile1';
: open BUGFILE2, '<Bugfile2';

  binmode THIS_SCRIPT;
  binmode BUGFILE1;
  binmode BUGFILE2;

That is all it takes.

Regards,
Mike Heins


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

Date: 27 Oct 1997 09:31:55 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: BUG in WinPerl; OK in Unix Perl
Message-Id: <01bce2bb$0c521940$02521e0a@tschai>



Pierre Fortin <pfortin@cisco.com> wrote in article
<3453E734.77CF2F94@cisco.com>...
> There is a bug in WinPerl wherein a file which contains 0x1A can't
be
> read past that point...
> 
open(FILE, "xxxx");
binmode(FILE)		# this does the trick


You have to open the file in binary mode because 0x1a means end of
file
(I walked into this 'feature' when I tried to read the width and
height of
gif files. Some gifs caused problems (yes you guessed right: at least
one of the dimensions was 26 pixels)

John

BTW this is in the FAQ

-- 
----------------------------------------------------------------------
------
C A S T L E  A M B E R      Freelance Software Development
(Java/Perl/C/CGI)
http://www.caiw.nl/~jbokma/ [Java demo's,Perl scripts,Xara graphics,
Resume]
mail:jbokma@caiw.nl         phone: +31 10 4291827



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

Date: 27 Oct 1997 10:15:27 GMT
From: Zenin <zenin@best.com>
Subject: Re: CGI tools
Message-Id: <631pjv$f26$2@nntp2.ba.best.com>

Connie Wang <c0w0461@unix.tamu.edu> wrote:
> I know all you guy said is correct. The thing is I am doing a project
> on dynamic database. I prefer to use win32odbc, but my boss  prefer to
> use cold fusion.

	Sorry to hear that.  I'd just get a new boss if I were you. :-)

> Bcause Cold fusion is labeled as easy to learn and easy to use, and
> most people thought it is difficult to learn pearl. I don't know how
> to persuade him. 

	Well, NT is labeled as, "easy to learn and easy to use", but I
	would _never_ recommend running a production server of any kind
	to anyone off it.  Sure, when you first start using it it's really
	easy to do the basic stuff, but as soon as you want to do anything
	even remotely non-basic you're soon in a huge pile of, "this would
	be a day of work under Unix, but to make NT do it meens 3 weeks of
	development time and it's still not going to _ever_ be able to do
	all of what we want...".

	The basic thing to remember is, 
		Easy != Efficient

	For the projects I do cold fusion and friends would _never_ even be
	given five minutes of my time.  I'd rather reinvent a better wheel
	then have to invent a way to make someone else's wheel turn
	sideways.

-- 
-Zenin (zenin@best.com)
 The Bawdy Caste (San Jose, CA)       http://www.netmagic.net/~dmcgrath/bawdy/
 Barely Legal   (Berzerkly, CA)                    http://www.barelylegal.org/
 Zenin's Rocky Archive (Moving soon!)              http://www.best.com/~zenin/


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

Date: Sun, 26 Oct 1997 10:42:04 -0800
From: Dominik Breitenbach <webmaster@breitenbach.net>
Subject: FOREACH command
Message-Id: <34538EFC.3D19@breitenbach.net>

Hi there

I have a little PERL programm. Whit it I can mail to several people, and
every recipient sees only his E-Mail address on his mail.
It works with a separate file, called "email.log", wherein the E-Mails
addresses of the recipients are contented.
The perl script gets the addresses by the following commands:

**********

 ....
$emaillog = "email.log";
 ....
open (EMAIL, "$emaillog");
@lines = <EMAIL>;
close (EMAIL);

*********

and then it prints the MAIL by the follwoing lines:

*********

foreach $line (@lines)
   {

   open (MAIL, "|$mailprog $line") || die "Can't open $mailprog!\n";

   print MAIL "Reply-to: $FORM{'emailadd'} ($FORM{'name'})\n";
   print MAIL "From: $FORM{'name'} <$FORM{'emailadd'}>\n"; 
   print MAIL "Subject: $FORM{'subject'}\n";
   print MAIL "To: $line\n";
   print MAIL "This should be an individual text\n\n";
   print MAIL "$FORM{'body'}\n";
 
   close (MAIL);
   }

*********

On the beginning of the body-text (line: 'print MAIL "This should be an
individual text\n\n"; ') I want to have an individual text like "Hello
Mark", "Hi Sandy", "Dear Billie" and so on.

I don't know the PERL-language, i.e. I can only suppose certain things
as far as PERL is similar to BASIC; and the Script is originally not
mine but one of Matthew Kruse.

CAN YOU HELP ME by telling me, how I can add to each mail an individual
text as written above? I would be very thankful.


Yours


Dominik Breitenbach


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

Date: Sun, 26 Oct 1997 18:07:12 -0800
From: rdm@cfcl.com (Rich Morin)
Subject: FYI: MacPerl, the MacPerl Pages, and an upcoming book
Message-Id: <rdm-2610971807120001@140.174.42.30>

MacPerl, a native port of Perl 5 to the Macintosh (both M68K and PPC) is
true freeware; both the source code and the binary executables are freely
redistributable.  MacPerl runs under both the Finder and MPW and supports
numerous Mac-related extensions (dialog boxes, AppleScript calls, etc).

The MacPerl Pages (http://www.ptf.com/macperl/) are a compendium of advocacy,
information, and resource pointers for MacPerl users.  If you have been
thinking about investigating MacPerl, drop by the Pages for a visit.  If you
have Mac-using friends who should try Perl, tell THEM to drop by for a visit!

Prime Time Freeware (http://www.ptf.com/), the sponsor of the MacPerl Pages,
is performing an experiment in online publishing and collective review.
Draft chapters of PTF's upcoming book, "MacPerl: Power and Ease", are
available on the MacPerl Pages for analysis and comment.  If you've been
hoping for a book on MacPerl, here's how to make sure you get what you want!


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

Date: Mon, 27 Oct 1997 06:08:13 GMT
From: yoshfuji@ecei.tohoku.ac.jp (YOSHIFUJI, Hideaki)
Subject: Re: HELP: Registration with .htaccess ????
Message-Id: <EIp51p.Lpw@yagi.ecei.tohoku.ac.jp>

In article <344FB734.7730DDB3@horizon.nl>, T. de Konink <tkonink@horizon.nl> says...
>- If someone has logged in (.htacces or ????) and starts a script within
>the zone (of scripts and pages), can I identify (within a Perl-script)
>the person by getting his Loginname somehow.

Use 'REMOTE_USER' environment variable (i.e. $ENV{'REMOTE_USER'}).


>- Can I use Cookies (getting/sending/deleting) within Perl-scripts ?

Use 'HTTP_COOKIE' environment variable (i.e. $ENV{'HTTP_COOKIE'}) to get cookies.
Use 'Set-Cookie' response header to set and/or delete cookies.


For further information about cookie, see 
<URL:http://home.netscape.com/newsref/std/cookie_spec.html> 
and <URL:http://help.netscape.com/kb/server/960513-111.html>.

-- 
YOSHIFUJI, Hideaki
E-Mail   : <URL:mailto:yoshfuji@ecei.tohoku.ac.jp>
Web Page : <URL:http://www.ecei.tohoku.ac.jp/~yoshfuji/>



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

Date: 27 Oct 1997 16:44:42 +1000
From: sspence@mincom.com (Stephen Spence)
Subject: NT Signal trapping ?
Message-Id: <631d8q$ccs$1@pithy.mincom.oz.au>

All,

Perl Windows/NT Build 310, 5.003_07

I have a perl program with a signal defined to execute a subroutine
when it is issued the signal

e.g.

$SIG{INT} = sub {die "outta here\n"};
sleep 500;

If I send the process id a kill 'INT' ,pid via another perl program,
the program exits with nothing being written to the screen.

I have tried a couple of different ways to define the signal but no luck.

Has anybody done this successfully ?

Mail prefered, will summarise,
Cheers,
Stephen Spence

sspence@mincom.com


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

Date: 27 Oct 1997 09:29:26 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: other language for perl
Message-Id: <01bce2ba$b3d4e680$02521e0a@tschai>



Tad McClellan <tadmc@flash.net> wrote in article
<2hur26.isk.ln@localhost>...
> Geoffrey Hebert (soccer@all-soccer.com) wrote:
> : I wish to translate my site to another language.
> 
> 
> Why do you so wish?
> 
> I assume there is some feature of Perl that you do not like?
> 
> Maybe there is a way to overcome that feature that we could suggest
> if we knew what feature that was...
> 
> 
> [ have you tried asking in   comp.lang.another   too?      ;-) ]
> 
> 
> 
> : Most of the site is html created from perl cgi.
> 
> 
> Because it is easy to generate web sites with Perl.
> 
> Please share with us whatever better language it is that you want
> to translate it to.
> 
> If there is something better, I'd like to check it out.
> 
> 
> 
> : Could someone tell me how the process might work?
> 
> 
> 1) Learn the new language.
> 
> 2) Read and understand each perl program.
> 
> 3) Rewrite the program in the new language.
> 
> Lather, rinse, repeat...

Or: 3) write a conversion program in Perl 8-).


-- 
----------------------------------------------------------------------
------
C A S T L E  A M B E R      Freelance Software Development
(Java/Perl/C/CGI)
http://www.caiw.nl/~jbokma/ [Java demo's,Perl scripts,Xara graphics,
Resume]
mail:jbokma@caiw.nl         phone: +31 10 4291827



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

Date: 27 Oct 1997 02:34:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Perl 5 and here documents
Message-Id: <630ukh$ivl@news-central.tiac.net>

In article <630lhr$ad2@news.onramp.net>,
Steve Walker <steve@nospam.thisdomain.com> wrote:
>I'm having problems with a script that uses lots of here documents. I keep 
>getting the error:
>
>   Can't find string terminator "      end_of_html" anywhere before EOF at    
>class_ad_test.cgi line 905.

>I've tried various terminators with and without leading spaces (indents) 
>and none work.

>Arrggghhhhh!
>
>Any ideas?

Is there whitespace (maybe a control M) at the end of the lines - this
can happen if you transfer a file from a DOS machien to a Unix machine?

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 27 Oct 1997 09:28:14 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: Perl 5 and here documents
Message-Id: <01bce2ba$88e90be0$02521e0a@tschai>



Steve Walker <steve@nospam.thisdomain.com> wrote in article
<630lhr$ad2@news.onramp.net>...
> I'm having problems with a script that uses lots of here documents.
I keep 
> getting the error:
> 
>    Can't find string terminator "      end_of_html" anywhere before
EOF at    
> class_ad_test.cgi line 905.
> 
> But the terminator IS there...here is a snippet of code that gives
an 
> error:

This is in the FAQ! The problem is that sometimes people put spaces
or tabs behind
the terminator. So move the cursor just behind the terminator and
press return.

John


-- 
----------------------------------------------------------------------
------
C A S T L E  A M B E R      Freelance Software Development
(Java/Perl/C/CGI)
http://www.caiw.nl/~jbokma/ [Java demo's,Perl scripts,Xara graphics,
Resume]
mail:jbokma@caiw.nl         phone: +31 10 4291827



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

Date: 27 Oct 1997 01:45:57 GMT
From: "David" <mysun@mbox2.singnet.com.sg>
Subject: problem about win32::odbc
Message-Id: <01bce27a$06ba6e60$511e09a8@weixiao.income.com.sg>

Hi, all,

I have tried to use win32::odbc to retrieve infomation from ODBC database,
but I encountered one problem. The following is my simplified application:

use Win32::ODBC;
$dsn = "MYDSN";
$id = "USERID";
$pw = "PASSWORD";
$db = new Win32::ODBC("dsn=$dsn;UID=$id;PWD=$pw");
$db->Sql("SELECT Note_Detail FROM details where Note_Num=9285");
$db->FetchRow();
$text = $db->Data("Note_Detail");
print $text;

$db->Close();

When I ran it under perl for win32 ver 5.001, Error: Parse exception
appeared, but not under ver 5.003.

Any comments or suggestions would be appreciated.

Thanks in advance




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

Date: Mon, 27 Oct 1997 02:51:36 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Q: perl->NT ?? :(
Message-Id: <34544809.1180@coos.dartmouth.edu>

Faust Gertz wrote:
> 
> you can convert it without making a mistake that is well documented in the
> Frequently Asked Questions (http://language.perl.com/faq/index.html),
> 
> :Why can't I use "C:\temp\foo" in DOS paths? What doesn't
> :`C:\temp\foo.exe` work?
> 
> :Whoops! You just put a tab and a formfeed into that filename! Remember that within double quoted strings (``like\this''), the
> :backslash is an escape character. The full list of these is in Quote and Quote-like Operators. Unsurprisingly, you don't have a file
> :called ``c:(tab)emp(formfeed)oo'' or ``c:(tab)emp(formfeed)oo.exe'' on your DOS filesystem.
> :
> :Either single-quote your strings, or (preferably) use forward slashes. Since all DOS and Windows versions since something like
> :MS-DOS 2.0 or so have treated / and \ the same in a path, you might as well use the one that doesn't clash with Perl -- or the
> :POSIX shell, ANSI C and C++, awk, Tcl, Java, or Python, just to mention a few.

Unfortunately, as an earlier post revealed, using forward slashes does
not work in a backtick quoted string under Windows 95.

I ran into this problem with a program I am developing for use on UNIX,
NT, and 95.  UNIX and NT work with this: `c:/dothis.exe`.  95 does not,
so I have to change those to fbackslashes if the ostype is Windows 95.

Chipmunk


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

Date: Sun, 26 Oct 1997 23:26:44 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: SOLVE and you'll be a GOD (in my eyes atleast)
Message-Id: <comdog-ya02408000R2610972326440001@news.panix.com>

In article <3453CFA6.B1849114@bitwiser.dk>, Michael Isaksen <mi@bitwiser.dk> wrote:

><A HREF="JavaScript:Open('http://bitwiser.dk/cgi-local/jai.pl/a
>parameter with blanks/')">
>but only the first word ends up in the $ENV{'PATH_INFO'}

you can't have whitespace in an URL.  although you can use any
replacement you wish, the CGI specification uses '+' for ' '.
you could also encode special characters with their hexadecimal
values.

>So I desided to replace the blanks to either a serie of letter or just
>another character.
>
>The milliondollar question is
>why does this code not work (or how to do):

>$astring = "a parameter with blanks";
>&Addparameter($astring);

>sub Addparameter
>{
>     my($parameter) = @_;
>
>     $dummyheader =~ s/ /+/g;
>     $parameter =~ tr/ /+/;

>}

not sure what you are trying to do, but i'll give you the easy answer
for URL encoding:

EASY ANSWER:

   #!/usr/bin/perl
   
   use URI::Escape;  # this module does all of the work
   
   $string = 'just another new york perl hacker';
   
   $escaped_string = uri_escape($string);
   
   print <<"EXAMPLE";
   old string: $string
   new string: $escaped_string
   EXAMPLE
   
   __END__
   
   old string: just another new york perl hacker
   new string: just%20another%20new%20york%20perl%20hacker

DIFFICULT ANSWER:

you could reinvent the wheel.  meanwhile all the movies, plays, and
concerts you wanted to see will happen without you as you commune
with your keyboard.

but that doesn't help you understand why you think that your code
is not working.  it prints

<B><A
HREF="JavaScript:Open('http://bitwiser.dk/cgi-local/jai.pl/a+parameter+with+blanks/')"></A></B><BR>

when i try it, which is what i think you wanted.  perhaps you could
explain why this is not what you expected or what you wanted...

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 27 Oct 1997 09:26:43 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: SOLVE and you'll be a GOD (in my eyes atleast)
Message-Id: <01bce2ba$5277ab20$02521e0a@tschai>



Steve Frost <frostbyt@shell02.ozemail.com.au> wrote in article
<630qeh$g5o$1@reader1.reader.news.ozemail.net>...
> Some time ago Michael Isaksen <mi@bitwiser.dk> wrote:
> >in making as script which makes list of links to perlscripts
> >eks:
> ><A
>
>HREF="JavaScript:Open('http://bitwiser.dk/cgi-local/jai.pl/aparameter
tothescrip
> >t/')">
> >
> >but i would like to be able to make a parameter (after jai.pl),
> >containing blanks.
> 
> Have you tried something like %20 instead of a space and
> then convert %20 to spaces in your script?  e.g.
> 
>    
http://www.frostbyte.com.au/frostbyte/cgi-bin/env.pl?some%20param
> 

Or use the +, which is the common space replacer 8-).

Or try this:

HREF="JavaScript:Open(
  escape('http://bitwiser.dk/cgi-local/jai.pl/aparametertothescript')
)

escape replaces spaces with + and "weird" characters with %hex

View the source of my homepage for an example 8-)

John


-- 
----------------------------------------------------------------------
------
C A S T L E  A M B E R      Freelance Software Development
(Java/Perl/C/CGI)
http://www.caiw.nl/~jbokma/ [Java demo's,Perl scripts,Xara graphics,
Resume]
mail:jbokma@caiw.nl         phone: +31 10 4291827



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

Date: Sun, 26 Oct 1997 23:24:11 -0600
From: Will <whs3@Ra.MsState.Edu>
Subject: tcp/ip connecttions
Message-Id: <Pine.SOL.3.96.971026232154.24584A-100000@Ra.MsState.Edu>


I am trying to find a perl script that will connect to a remote host,
rlogin as a particular user, execute a few commands and then close the
connection. I've been looking for a while now and so far I have been
unable to fine anything to do this. I'd appreciate any help anyone can
give me. Thanks...



========================================================================
             Atheism is a non-prophet organization.
========================================================================



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

Date: Mon, 27 Oct 1997 11:19:39 +0100
From: Doug Seay <seay@absyss.fr>
Subject: Re: the disappearing label problem...
Message-Id: <34546ABB.27C4B1AC@absyss.fr>

Tom Phoenix wrote:
> 
> Tell your customers that, in order to accommodate the folks who won't
> upgrade to Perl 5, that you're going to require all of them to downgrade
> to Perl 4. If they don't like that, try requiring that they all install
> Perl 5. :-)

Tom, don't even joke about such things.

- doug


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

Date: Sun, 26 Oct 1997 21:04:35 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <345404C3.71557E54@gpu.srv.ualberta.ca>

John Robson wrote:
!
! The Perl Journal seems to be the only magazine dedicated to
! Perl.  I went to its website, read some reviews and it looks
! to me like a fine journal except for the fact that it's
! published only 4 times a year (quarterly).

that it is only published quarterly is my only complaint :-)
 
! I would like to hear your opinions on it.  Do you find it
! useful? 

yes

! Is it slanted toward the beginner or the expert, or
! both? 

both

! Does it have only Perl code,

no...

! or does it also have fun anecdotal stories about how people
! use Perl creatively?

yes

! What do you like best about the Perl Journal?
 
the cover of issue 4 volume 1   :-)

uh oh...that reminds, I forgot to renew my subscription :-(
gripe #2, they only send one reminder and my memory hasn't
been the same 'since the accident'! Sure hope I'm not too late
to restart with the fall issue!

regards
andrew


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1232
**************************************

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