[16892] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4304 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 12 21:05:38 2000

Date: Tue, 12 Sep 2000 18:05:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <968807120-v9-i4304@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 12 Sep 2000     Volume: 9 Number: 4304

Today's topics:
    Re: @array <elephant@squirrelgroup.com>
    Re: @array <elephant@squirrelgroup.com>
    Re: @variable_list2 <yanick@babyl.sympatico.ca>
    Re: Apche: How can I prevent denial of service? (Malcolm Dew-Jones)
    Re: Apche: How can I prevent denial of service? (brian d foy)
    Re: build problem (Steve)
    Re: Change Windows Desktop BG <elephant@squirrelgroup.com>
    Re: Compiling cgi scripts  (Steve)
        CVS, Perl, Build Control and free Nerf Gun nawkboy@yahoo.com
    Re: hash arrays... <alvaro@arbol-logika.com>
    Re: hash arrays... (Eric Bohlman)
    Re: hash arrays... (Tim)
    Re: hash arrays... (Gwyn Judd)
        Hash vs. Binary Tree rathmore@tierceron.com
    Re: Hash vs. Binary Tree (Jerome O'Neil)
    Re: help in writing a card game (Gwyn Judd)
        Help with perl/cgi (using book: perl,cgi, and javascrip <peterp100@hotmail.com>
    Re: HELP! urgent but easy <gorgano@altavista.com>
    Re: how to  encrypt source code? (Jerome O'Neil)
    Re: how to remove unprintable  chars with Perl script <godzilla@stomp.stomp.tokyo>
    Re: how to remove unprintable  chars with Perl script <godzilla@stomp.stomp.tokyo>
    Re: how to remove unprintable  chars with Perl script <elephant@squirrelgroup.com>
    Re: how to remove unprintable  chars with Perl script <peter.sundstrom@eds.com>
    Re: how to remove unprintable chars with Perl script <elephant@squirrelgroup.com>
    Re: Is HP finally recognizing Perl??? (Richard J. Rauenzahn)
    Re: Newbie to CGI <elephant@squirrelgroup.com>
    Re: Newbie to CGI <juex@deja.com>
    Re: Newbie to CGI (Steve)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 13 Sep 2000 10:32:14 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: @array
Message-Id: <MPG.142959f9d0e571e7989794@localhost>

Anders Lund <anders@wall.alweb.dk> wrote ..
>Todd Anderson wrote:

  [ same code that's been posted to a whole bunch of threads snipped ]

>you need to read a bit on hashes...

Anders .. you need to read a bit on anonymous arrays .. the foreach 
clause was iterating through the anonymous array values of the hash 
elements - and doing it perfectly well

>foreach $co_name (keys %comanies) { do $stuff }

in this loop (assuming that the names were correct) you'd iterate 
through all the states (not with the originator wanted) setting $co_name 
to each arrayref in no particular order

almost certainly of absolutely no use in the context of outputting the 
companies in a given state

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 13 Sep 2000 10:34:34 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: @array
Message-Id: <MPG.14295a877d8720ef989795@localhost>

  [ posted to comp.lang.perl.misc and CCed to todd@mrnoitall.com ]

Todd .. stop creating new threads that ask the same bloody question .. 
you've been given a few answers .. at least one of which actually tested 
the code that you're using (which works perfectly well) and provided a 
probably cause of your problem

from memory it was in the @variable_list2 thread .. but (like most 
everyone here) I've lost count of the number of these threads that 
you've created

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 13 Sep 2000 00:20:49 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: @variable_list2
Message-Id: <BLzv5.8448$Kp4.304905@news20.bellglobal.com>

jason <elephant@squirrelgroup.com> wrote:

: what about the originator's post do you think was incorrect ? .. 

	Uh...

	*look back at the initial post*

	Darn it. It compiles. 8-I

	Sorry, knee-jerk reaction. I saw %stuff_1 and %stuff_2 and hashes
	containing array references and thrice imbedded {}s coupled with
	a '@' and thought that was it, major data structure problem. But 
	it seems that exception mae if a missing final '~', an
	undeclared "$form_data{'state'}" and <OPTION>s all set to 
	the same value, the code is running just fine. 

	My bad. Sorry again. 

: try not to post answers that don't actually answer the question being 
: asked - it's misleading and confusing

	*blush*

	Mea culpea. I'll try to make amend. 

Yanick

--
$\="\n";$_='089101116 097110'.(1x5).'6104101114 080101114108'
 .' 104097099107101114046';until(7==y/Ya-zP./Ya-zP./ / y/ / /
){s/\d{3}/rand()<0.2?chr$&:$&/xeg;s/[Pa-zY.]/rand()<0.05?
sprintf"%03d",ord$&:$&/xeg;print;}


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

Date: 12 Sep 2000 15:07:43 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Apche: How can I prevent denial of service?
Message-Id: <39bea92f@news.victoria.tc.ca>

nl1753@my-deja.com wrote:
: Hi here!
: How can i limit the number of connections or sockets that one IP-Adress
: is allowed to open on Port 80?

Hack the kernal.

Then post your code because this would be useful.



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

Date: Tue, 12 Sep 2000 19:26:42 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Apche: How can I prevent denial of service?
Message-Id: <brian-ya02408000R1209001926420001@news.panix.com>

In article <39bea92f@news.victoria.tc.ca>, yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) posted:

> nl1753@my-deja.com wrote:

> : How can i limit the number of connections or sockets that one IP-Adress
> : is allowed to open on Port 80?

> Hack the kernal.

or configure the server. ;)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: 13 Sep 2000 00:51:35 +0100
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: build problem
Message-Id: <slrn8rtftj.8n3.steve@zero-pps.localdomain>

On Tue, 12 Sep 2000 10:58:51 -0500, John Coers wrote:
>Howdy,
>
>Are sv_yes, sv_no, and sv_undef CORE perl functions?  If so, where are they defined?  I have poked around
>all through where I though they might be, but no joy.  I see they are mentioned on the perlguts man, but 
>the info I need is not included.

Ok I got these results from a search:

i386-linux/CORE/embedvar.h:#define sv_yes
i386-linux/CORE/embedvar.h:#define sv_no
i386-linux/CORE/embedvar.h:#define sv_undef

So from this I know they're defined in embedvar.h

Hope that helps. 

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

 11:36pm  up 22 days,  3:49,  3 users,  load average: 1.03, 1.01, 1.00


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

Date: Wed, 13 Sep 2000 09:56:00 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Change Windows Desktop BG
Message-Id: <MPG.1429518061589002989792@localhost>

Henry Hartley <hartleh1@westat.com> wrote ..
>> > James M. Luongo <jluongonospam@draper.com> wrote ..
>> > > How would I use Perl for Windows to randomly change my windows desktop
>> > > background each time I logged into my computer?
-
>for the standard documentation.  I wrote a short script that rotated
>through a collection of Wallpapers (on an NT machine and using the old
>Win32::Registry module) but it only worked on a restart (or a re-login,
>really) because updating the Registry is not the whole battle.  You have
>to make the system reread the registry and I never figured out how to do
>that from the script.  Is that possible with the newer modules?  If so,
>it's not obvious from the docs.

the originator just wanted to have it changed each time they log into 
their computer .. so it's not an issue to have it change dynamically - 
as you explain

but to answer your question .. no - you can't have it change instantly 
using the registry modules .. it's not a function of the registry - it's 
a function of the WINAPI .. there are WINAPI calls (conveniently outside 
the scope of this newsgroup ;) that can be used to trigger refreshes of 
that sort of data

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: 13 Sep 2000 00:51:35 +0100
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: Compiling cgi scripts 
Message-Id: <slrn8rtg6n.8n3.steve@zero-pps.localdomain>

On Tue, 12 Sep 2000 16:03:55 +0300, Benny Siegelov wrote:
>I can't compile any script makes use CGI; line
>I have tried both backend and frontend(perlcc) compilers
>It types "No definition for sub CGI::(all CGI modules sub names)"
>Help me plz

It souns asthough it's expecting that lot to be prototyped somewhere
but isn't finding them or it.

Have you got the  #!/usr/bin/perl line at the top of your script? 
Just a stab in the dark, I've never compiled any of my scripts.   



-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

 11:36pm  up 22 days,  3:49,  3 users,  load average: 1.03, 1.01, 1.00


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

Date: Tue, 12 Sep 2000 22:12:12 GMT
From: nawkboy@yahoo.com
To: jcarpenter@questia.com
Subject: CVS, Perl, Build Control and free Nerf Gun
Message-Id: <8pm9na$kgh$1@nnrp1.deja.com>

I am looking for a nice way to handle build control for a bunch of perl
modules under CVS.  I can't help but think there are some really good
solutions out there, Unfortunately I'm having no luck finding anything
on CPAN, perl.com, perl man pages, Oreilly Perl texts, or even on the
CVS related pages.

For now I am performing builds by manually exporting a release tag from
CVS and then doing the usual perl Makefile.PL, make, make test, make
install for every module in the release.  I have set up my module
definitions file in CVS to ensure that any executables belonging
in /usr/local/bin are placed in a special directory during export.
There has got to be a better way to do this then rolling a whole bunch
of custom code and learning from my own mistakes when I could be taking
the advice of others who have surely done this before.  I am hoping to
find some tools that provide nice build histories, incremental builds,
an easy way to roll back changes, etc.

Please copy me via email on any reply to this newsgroup, since I may
miss the post otherwise.  Any guidance is greatly appreciated.  Really
good thorough answers may even receive a free Nerf gun.

Jimmy Carpenter
Software Engineer
Questia
3 Greenway Plaza
Suite 1700
Houston, TX  77046
desk: 713-358-2662
email: jcarpenter@questia.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 12 Sep 2000 18:10:04 -0400
From: "Alvaro Bahamondes V." <alvaro@arbol-logika.com>
Subject: Re: hash arrays...
Message-Id: <39bea9b9@dnewserver.firstcom.cl>

Sorry I think I din't explain my problem well.
I will receive as a parameter a string containing pairs (key, data). I can
define
the format of the string so the format is not a problem. I would like
to put this string in a hash so I can access it easly. I did it with a split
and works, but, because this string can be large I'm worried about
the performance of the split function. My question if there are any
other way to assign this string to a hash "more directly" (more efficient)
???

- my previous post
#this is the string and may be a big one (I can change the
#format of the string without a problem).
    $r="1, a,  2, b, 3, c";
#and I create the hash like this:
    %t = split(",",$r);

Thanks a lot for your answers.

Alvaro




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

Date: 12 Sep 2000 22:26:50 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: hash arrays...
Message-Id: <8pmaja$qdb$2@slb6.atl.mindspring.net>

Alvaro Bahamondes V. (alvaro@arbol-logika.com) wrote:
: Sorry I think I din't explain my problem well.
: I will receive as a parameter a string containing pairs (key, data). I can
: define
: the format of the string so the format is not a problem. I would like
: to put this string in a hash so I can access it easly. I did it with a split
: and works, but, because this string can be large I'm worried about
: the performance of the split function. My question if there are any
: other way to assign this string to a hash "more directly" (more efficient)

I think you're worrying about efficiency prematurely.  Most programmers' 
intuition about speed efficiency isn't all that good, and it's very easy 
to waste time optimizing things that don't need to be optimized.  If 
you're concerned about the efficiency of some operation, *measure* it 
first.  In this case, it's quite unlikely that any other scheme will be 
significantly faster than using split.

: - my previous post
: #this is the string and may be a big one (I can change the
: #format of the string without a problem).
:     $r="1, a,  2, b, 3, c";
: #and I create the hash like this:
:     %t = split(",",$r);

This doesn't take the whitespace around the commas into account.  Unless 
you actually want your hash values to have leading or trailing 
whitespaces, you should split on /\s*,\s*/ instead.



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

Date: Tue, 12 Sep 2000 23:23:42 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: hash arrays...
Message-Id: <8FADB5FE0indigodimcom@166.93.207.145>

alvaro@arbol-logika.com (Alvaro Bahamondes V.) wrote in
<39bea9b9@dnewserver.firstcom.cl>: 

>My question if there are any
>other way to assign this string to a hash "more directly" (more
>efficient) ???
>
>- my previous post
>#this is the string and may be a big one (I can change the
>#format of the string without a problem).
>    $r="1, a,  2, b, 3, c";
>#and I create the hash like this:
>    %t = split(",",$r);

This is exactly the kind of situation split is meant for.  If you
don't think it is fast enough, you should consider whether Perl
is the right tool for you situation.

-T


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

Date: Wed, 13 Sep 2000 00:14:27 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: hash arrays...
Message-Id: <slrn8rthn0.id4.tjla@thislove.dyndns.org>

I was shocked! How could Alvaro Bahamondes V. <alvaro@arbol-logika.com>
say such a terrible thing:
>Sorry I think I din't explain my problem well.
>I will receive as a parameter a string containing pairs (key, data). I can
>define
>the format of the string so the format is not a problem. I would like
>to put this string in a hash so I can access it easly. I did it with a split
>and works, but, because this string can be large I'm worried about
>the performance of the split function. My question if there are any

use Data::Dumper;
$r="1, a,  2, b, 3, c";
%t = eval $r;

print Dumper \%t;

Works for me

:)

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
A bachelor is a man who never made the same mistake once.


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

Date: Tue, 12 Sep 2000 23:13:32 GMT
From: rathmore@tierceron.com
Subject: Hash vs. Binary Tree
Message-Id: <8pmdab$op3$1@nnrp1.deja.com>

file_x has 605 random pieces of data.

I need to read from a file, call it file_y, and then search in file_x
and see if I can find a match in file_x for a field that I read from
file_y. If a match is found, I need to manipulate and write out to a
third file the data found in file_y.

Reading from file_x each time that I want to find a match seems like a
very slow approach. So, should I create a hash of all 605 elements, or
would a binary tree be a better approach? I will never need to add or
delete elements from file_x so the main action performed on file_x is a
search. That's what got me to thinking binary tree, but the Perl
Cookbook says that while performance may suffer using a hash, it
probably won't suffer enough to justify a fancy algorithm. So, what
should I do?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 12 Sep 2000 23:29:55 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Hash vs. Binary Tree
Message-Id: <T%yv5.865$Xt4.341633@news.uswest.net>

rathmore@tierceron.com elucidates:
> file_x has 605 random pieces of data.

> Reading from file_x each time that I want to find a match seems like a
> very slow approach. So, should I create a hash of all 605 elements, or
> would a binary tree be a better approach? I will never need to add or
> delete elements from file_x so the main action performed on file_x is a
> search. That's what got me to thinking binary tree, but the Perl
> Cookbook says that while performance may suffer using a hash, it
> probably won't suffer enough to justify a fancy algorithm. So, what
> should I do?

Use the hash.  For 605 elements, the difference in runtime performance
will be negligable, while the difference in programmer time will
be significant.


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

Date: Wed, 13 Sep 2000 01:02:45 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: help in writing a card game
Message-Id: <slrn8rtkhi.id4.tjla@thislove.dyndns.org>

I was shocked! How could Tony L. Svanstrom <tony@svanstrom.com>
say such a terrible thing:
>Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>
>        <cut]
>
>Isn't this thing worrying y'all? The new ones in c.l.p.m might actually
>start listening to this one and start getting "good" advice via
>e-mail... And judging from what's been said lately that would mean
>semi-working Perl4 code.

Who cares. Anyone that listens to "Moron-zilla" and can't tell she is
full of it deserves all they get.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Experience is that marvelous thing that enables you recognize a mistake
when you make it again.

		-- Franklin P. Jones


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

Date: Tue, 12 Sep 2000 23:07:43 -0400
From: peter <peterp100@hotmail.com>
Subject: Help with perl/cgi (using book: perl,cgi, and javascript complete)
Message-Id: <lr8urscrba5uat1lsi2qdd95cjvck8jv3e@4ax.com>

I need help with a perl/cgi problem. I'm using the book: Perl, Cgi,
and Javascript Complete, by Sybex.

I'm working through Chapter 12: "Creating Real-World HTML Forms with
Perl and Cgi."

This book isn't bad, but it doesn't explain everything.

I have several questions, if someone has worked with this book, please
reply.

Also, is anyone can point me to any documentation on running CGI
scripts using mandrake 7.1 (red-hat) and perl, that would be great.
Right now, I'm having problems getting scripts running, like counters
and guest books.

Thanks,

peter


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

Date: Tue, 12 Sep 2000 22:22:34 GMT
From: Jason Hurst <gorgano@altavista.com>
Subject: Re: HELP! urgent but easy
Message-Id: <8pmaak$l7e$1@nnrp1.deja.com>

Here try this out.  If you want a little more info on how this works
look at your documentation under the LWP module.  But this may work as
a quick fix if thats all you need..

----
# Create a user agent object
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("MyBot/0.1 " . $ua->agent);

# Create a request
my $req = new HTTP::Request('GET', 'http://foo.com');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_error) {
  #error occured do whatever
  ...
}

----


In article <39BE959F.A7DD6A14@roadtv.de>,
  j.pfeiffer@roadtv.de wrote:
> all i got to know is:
> how do i check if  a file exists on another server??
> if (-e "http://www.domain.de/tage/$welchertag.html") didnt work.
>
> joerg
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 12 Sep 2000 22:30:00 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: how to  encrypt source code?
Message-Id: <I7yv5.842$Xt4.314038@news.uswest.net>

tony@svanstrom.com (Tony L. Svanstrom) elucidates:
> DT <dsa@dassda.com> wrote:
> 
>> I tried but all encrypted source code read:  Vyznev vf n n zbgure shpxre
> 
> *PLONK*

Don't you mean *CYBAX*

?


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

Date: Tue, 12 Sep 2000 16:22:32 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: how to remove unprintable  chars with Perl script
Message-Id: <39BEBAB8.3F5BCC01@stomp.stomp.tokyo>

Durk Gardenier wrote:
 
> This initially seemed easy , but it has taken
> me quite some time and I still have not found
> an answer.
 
> If a file contains unprintable characters, how can I
> remove them with a perl script?


Not as difficult as you might think. However, doing this
can be very tricky, as you will discover if you experiment
with a generic regex or an array / loop generic regex.

Perl will allow import of odd characters for some functions
but not all functions nor all combinations of functions.
Trial and error is an approach to develop a table of what
you can do and cannot do with special characters and specific
Perl functions and specific combinations of Perl functions.

Experiment with various regex / substitutions and discover
how quickly almost all variations fail, unless you address
these unprintables very specifically and directly.

This test script below will catch most Windows type
unprintable characters. You may need to add a few to
catch all. I didn't make a table of all unprintable
characters under common Windows systems. However,
this works well for very common day applications
where you might expect _average_ unprintables. It
also provides the logic behind doing this but is
not a catch-all cure without developing an extensive
table of unprintable characters.

This term unprintable is, of course, operating system
sensitive. How you handle this depends on what type of
system will eventually 'print' your output. Discussion
of ASCII versus Binary print would be oxymoronic.

Another approach would be to address in HEX format.
These HEX characters represent almost all unprintables,
and all ranges are inclusive:

00 to 19 
1A - 1F
AA - AF
B0 - B9
B1 - B9
BA - BF
C0 - C9
CA - CF
D0 - D9
DA - DF
E0 - E9
EA - EF
F0 - F9
FA - FF

I haven't played with HEX formats to remove unprintables,
so the actual mechanism is for you to discover.


For AR Techno-Geeksters, before you suffer anxieties,
begin passing gas while screaming "What If!" do note
I stated this is not a cure all and is operating system
sensitive along with print style sensitive.

This is an example of "how" this could be approached.

Friggin Bozos. Jeesshh....


Godzilla!
-- 
print "http://3483852801/%7e%63%61ll%67i%72l";


#!/usr/local/bin/perl

print "Content-type: text/plain\n\n";


## Win Specific:

$string = "abc Ž def";

print "\nInput:\n\n$string";

$string =~ s/\x8d\x8e\x8f\x90//g;

print "\n\nSpecific Output:\n\n$string";


## Win Generic:

$string = "abc €Žž def";

print "\n\nInput:\n\n$string";

$string =~ s/\x7f//g;
$string =~ s/\x80//g;
$string =~ s/\x81//g;
$string =~ s/\x8d//g;
$string =~ s/\x8e//g;
$string =~ s/\x8f//g;
$string =~ s/\x90//g;
$string =~ s/\x9d//g;
$string =~ s/\x9e//g;

print "\n\nGeneric Output:\n\n$string";


exit;

PRINTED RESULTS:
________________


Input:

abc Ž def

Specific Output:

abc  def

Input:

abc €Žž def

Generic Output:

abc  def


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

Date: Tue, 12 Sep 2000 16:37:28 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: how to remove unprintable  chars with Perl script
Message-Id: <39BEBE38.91A66DB2@stomp.stomp.tokyo>

Godzilla! wrote:
 
> Durk Gardenier wrote:

 
Reviewing my article, I discover I have a typo
error in this Hex table.

B0 - B9
B1 - B9

Take out B1 - B9 for clear reasons and, don't
ask what led my fingers to type that. =)


 
> 00 to 19
> 1A - 1F
> AA - AF
> B0 - B9
> B1 - B9  <---- ERROR
> BA - BF


Godzilla!
--
Androids And More
  http://la.znet.com/~callgirl/android.html


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

Date: Wed, 13 Sep 2000 10:54:23 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: how to remove unprintable  chars with Perl script
Message-Id: <MPG.14295f2e1f3acc55989797@localhost>

Durk Gardenier <d.gardenier@iae.nl> wrote ..
>This initially seemed easy , but it has taken
>me quite some time and I still have not found
>an answer.
>
>If a file contains unprintable characters, how can I
>remove them with a perl script?

see the perldata section of the documentation .. specifically the part 
that talks about "Scalar value constructors" .. then follow the 
reference to "Quote and Quote-like Operators" in perlop

you should know everything you need to about non printing characters 
then

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 13 Sep 2000 12:19:55 +1200
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: how to remove unprintable  chars with Perl script
Message-Id: <8pmhg3$g87$1@hermes.nz.eds.com>


>Durk Gardenier wrote:
>
>> This initially seemed easy , but it has taken
>> me quite some time and I still have not found
>> an answer.
>
>> If a file contains unprintable characters, how can I
>> remove them with a perl script?


If you are on a Unix system, you could always use 'strings'

man strings




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

Date: Wed, 13 Sep 2000 10:58:54 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: how to remove unprintable chars with Perl script
Message-Id: <MPG.14296035653f238a989798@localhost>

Rodney Engdahl <red_orc@my-deja.com> wrote ..
>In article <8pm5ii$6k0$1@news.IAEhv.nl>,
>  "Durk Gardenier" <d.gardenier@iae.nl> wrote:
>> This initially seemed easy , but it has taken
>> me quite some time and I still have not found
>> an answer.
>>
>> If a file contains unprintable characters, how can I
>> remove them with a perl script?
>>
>
>you could try a regular expression and specify the characters you want
>to remove:
>
>$var = "a bunch of characters, and considering the 'c' and 'e' to be
>unprintable for example.";
>
>$var =~ s/(?:c|e)//g;

I think you might have missed the point Rodney .. 'unprintable 
characters' usually refer to control characters like "\b" and "\a" .. 
see the documentation pointers I mentioned elsewhere in this thread if 
you're interested

and just quietly .. your above removal would have been better done with 
the tr/// operator and the 'd' modifier .. check perlop for more details 
on that

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: 12 Sep 2000 22:51:32 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Is HP finally recognizing Perl???
Message-Id: <968799089.466536@hpvablab.cup.hp.com>



Larry Rosler <lr@hpl.hp.com> writes:
>You are confusing the perl bundled with the OS (evidently used by some 
>build or initialization procedures) with the perl used to teach this 

Rumor has it that its for q4 support...

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Wed, 13 Sep 2000 10:01:31 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Newbie to CGI
Message-Id: <MPG.142952c5f3d9cef3989793@localhost>

Tigz <tigz@ntlworld.com> wrote ..
>> Yep.  You're posting a cgi question to a perl newsgroup...
>>
>> Try one of the comp.infosystems.www.* newsgroups.
-
>Well I am sorry David!, I if you have read the subject line you will have
>reilized that it says "Newbie to CGI". Now that to me, seems a good enough
>explanation as to why it has been posted in the wrong newsgroup!!!

no .. that's no explanation at all .. perhaps a subject that included 
"New to the internet" .. or "New to usenet" .. or "New to newsgroups" .. 
or "Just born" would have helped

being new to CGI has no bearing on posting an article in the wrong 
newsgroup .. go away - learn how to use usenet .. then post in the 
appropriate group

>You see i dont know all this stuff, like as it says in the subject, i am a
>newbe to cgi, all i know is that they are 2 programming languages.

well - I'm afraid that if that's all you know - then you don't know 
anything .. there are a couple more than two programming languages

  [ jeopardectomy performed ]

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Tue, 12 Sep 2000 16:27:05 -0700
From: "Jόrgen Exner" <juex@deja.com>
Subject: Re: Newbie to CGI
Message-Id: <39bebbca$1@news.microsoft.com>

"Tigz" <tigz@ntlworld.com> wrote in message
news:yAwv5.11960$Xe4.182153@news6-win.server.ntlworld.com...
> Well I am sorry David!, I if you have read the subject line you will have
> reilized that it says "Newbie to CGI". Now that to me, seems a good enough
> explanation as to why it has been posted in the wrong newsgroup!!!

You mean, because I'm new to sailing justifies asking in a grocery store
about how to hoist sails? Interesting concept...

kie




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

Date: 13 Sep 2000 00:51:34 +0100
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: Newbie to CGI
Message-Id: <slrn8rtf4p.8n3.steve@zero-pps.localdomain>

On Tue, 12 Sep 2000 19:08:17 +0100, Tigz wrote:
>HI, I'm totally new to CGI, I have got a few cgi applications working, but i
>cant seem to get a counter working.
>When i call the counter useing ssi i get the following message:
>"[an error occurred while processing this directive] "
>could someone please explane to me what i am doing wrong.

I found that by running the script from the command line can give me
a lot of information about what's going wrong and also looking at the
error log for the web server usually gives good information too. 

Hope that helps. 

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

 11:36pm  up 22 days,  3:49,  3 users,  load average: 1.03, 1.01, 1.00


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


------------------------------
End of Perl-Users Digest V9 Issue 4304
**************************************


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