[16177] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3589 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 18:23:43 2000

Date: Mon, 10 Jul 2000 15:23:30 -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: <963267810-v9-i3589@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3589

Today's topics:
        paging a text file? (Johnny)
    Re: paging a text file? (David Efflandt)
    Re: paging a text file? <bwalton@rochester.rr.com>
        Parsing data? (SC)
    Re: Parsing data? (Keith Calvert Ivey)
    Re: Pattern Matching (M.J.T. Guy)
    Re: Pattern Matching <dburch@teleport.com>
    Re: Pattern Matching <adetalabi@clara.co.uk>
        Pattern Matching: Replacing "+" with space <president@webticker.com>
    Re: Pattern Matching: Replacing "+" with space <nnickee@nnickee.com>
    Re: Pattern Matching: Replacing "+" with space (Abigail)
    Re: Pattern Matching: Replacing "+" with space <nnickee@nnickee.com>
        Perl & Apache Books for sale by O'Reilly! Also Python & <scott@lund.com>
    Re: Perl & Apache Books for sale by O'Reilly! Also Pyth <rob13@rock13.com>
        Perl - internal server errors <jbizekNOjbSPAM@hotmail.com.invalid>
    Re: Perl - internal server errors <care227@attglobal.net>
    Re: Perl - internal server errors (Tad McClellan)
    Re: Perl - internal server errors <bill.kemp@wire2.com>
        perl / serial comms / win32 <brendon@shipreg.com>
    Re: perl / serial comms / win32 (David Efflandt)
        perl 5.005_03 on Linux fails lib/ipc_sysv.t test (Mark Post)
    Re: perl 5.005_03 on Linux fails lib/ipc_sysv.t test <gellyfish@gellyfish.com>
    Re: perl 5.005_03 on Linux fails lib/ipc_sysv.t test (Mark Post)
        Perl and Locales <tonyboy@earthling.net>
    Re: Perl and Locales <tonyboy@earthling.net>
        Perl CGI for Remote Control? <dward@pla.net.au>
    Re: Perl CGI for Remote Control? (Craig Berry)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 08 Jul 2000 18:04:25 GMT
From: funny@aol.com (Johnny)
Subject: paging a text file?
Message-Id: <J2K95.17444$Q8.79445@typhoon.ne.mediaone.net>

Hi,

I have a couple of scripts that retreive data from a text file but put out alkl 
the lines found. 

Any examples where I can specify displaying x number of lines per per display?

Thanks in advance.

burt@ici.net



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

Date: 8 Jul 2000 23:07:40 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: paging a text file?
Message-Id: <slrn8mfd1i.qrn.efflandt@efflandt.xnet.com>

On Sat, 08 Jul 2000 18:04:25 GMT, Johnny <funny@aol.com> wrote:
>Hi,
>
>I have a couple of scripts that retreive data from a text file but put
>out all the lines found. 
>
>Any examples where I can specify displaying x number of lines per per display?
>
>Thanks in advance.
>
>burt@ici.net

A simple example that assumes that lines are not wider than your display.
Your mission, should you decide to accept it, is to determine what to do
if lines wider than your display wrap:

#!/usr/bin/perl -w
$file = shift || $0;
open(FILE,"$file") || die "Can't open $file: $!";
$|++;   # unbuffered so prompt displays without newline
while (! eof(FILE)) {
    for $i (1..23) {
        $line = <FILE> || last;
        # do something here if $line is too long
        print $line;
    }
    print "Press <enter> to continue: ";
    <STDIN>; print "\n";
}


-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Sat, 08 Jul 2000 23:19:02 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: paging a text file?
Message-Id: <3967B72B.9FFE211A@rochester.rr.com>

Johnny wrote:
 ...
> I have a couple of scripts that retreive data from a text file but put out alkl
> the lines found.
> 
> Any examples where I can specify displaying x number of lines per per display?
 ...
> burt@ici.net

perldoc perlform
-- 
Bob Walton


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

Date: Fri, 07 Jul 2000 05:11:35 GMT
From: supersalo@excite.com (SC)
Subject: Parsing data?
Message-Id: <39656639.11521197@enews.newsguy.com>


I've got a segment of code that extracts the IP Address of a machine.

@ifconfig gets populated with the interface info:

        @ifconfig=
        "eth0      Link encap:Ethernet  HWaddr 00:00:00:66:00:XX 
          inet addr:1.1.1.200  Bcast:1.255.255.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:100 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:100 
          Interrupt:9 Base address:0xde80";



The code to extract the IP Address looks like this:
       
($ifconfig) = eval {grep /inet addr:(\d+\.\d+\.\d+\.\d+)/, @ifconfig};
($ip_linux1) = $ifconfig =~ /inet addr:(\d+\.\d+\.\d+\.\d+)/;


Can anyone think of a way that I could parse out the IP Address in one
line (instead of 2)?

Sal


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

Date: Fri, 07 Jul 2000 12:18:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Parsing data?
Message-Id: <3965c8fe.35076907@nntp.idsonline.com>

supersalo@excite.com (SC) wrote:

>        @ifconfig=
>        "eth0      Link encap:Ethernet  HWaddr 00:00:00:66:00:XX 
>          inet addr:1.1.1.200  Bcast:1.255.255.255  Mask:255.255.255.0
>
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
>          RX packets:100 errors:0 dropped:0 overruns:0 frame:0 
>          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0 
>          collisions:0 txqueuelen:100 
>          Interrupt:9 Base address:0xde80";

You're setting an array variable equal to a scalar.  That gives
you an array with only one element.  Change @ifconfig to
$ifconfig.

>The code to extract the IP Address looks like this:
>       
>($ifconfig) = eval {grep /inet addr:(\d+\.\d+\.\d+\.\d+)/, @ifconfig};
>($ip_linux1) = $ifconfig =~ /inet addr:(\d+\.\d+\.\d+\.\d+)/;
>
>Can anyone think of a way that I could parse out the IP Address in one
>line (instead of 2)?

Once you've made the change above, the $ip_linux1 line will work
without the one above it (and I don't understand what you think
the eval is doing in that one, anyway).

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: 4 Jul 2000 18:07:36 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Pattern Matching
Message-Id: <8jt958$foh$1@pegasus.csx.cam.ac.uk>

Dan Burch  <dburch@teleport.com> wrote:
>I've been working on a script on my developement box (win98 running
>apache and perl5.00502).  The script reads a csv txt file, splits the
>line and tries to make a match to a vaiable that has been passed to it. 
>I use a pattern match 
>
>if ( $list[2] =~ /\b$search_name\b/ ) 
>
>that works perfectly on that machine, but when I loaded it to my Unix
>server(solaris running apache and perl5.00404) it it didn't make the
>match. After trying many different combination(hours of banging my head
>on my desk) and testing to see if $list[2] and $seacrh_name were actualy
>there I took a stab in the dark and added a ?.
>
>if ( $list[2] =~ /\b$search_name?\b/)
>
>and it worked, but I don't understand why, and that disturbs me because
>I'm not sure whats going on. I'm hoping someone can shed some light on
>this for me.

Let me guess:   you read in $search_name and forgot to chomp() it.


Mike Guy


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

Date: Tue, 04 Jul 2000 16:08:46 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: Pattern Matching
Message-Id: <39626E7E.873035C3@teleport.com>




> >there I took a stab in the dark and added a ?.
> >
> >if ( $list[2] =~ /\b$search_name?\b/)
> >
> >and it worked, but I don't understand why, and that disturbs me because
> >I'm not sure whats going on. I'm hoping someone can shed some light on
> >this for me.
> 
> Let me guess:   you read in $search_name and forgot to chomp() it.

Well I chomp() it, but I guess there must of been more then one
character there.  Then I saw another post about carriage returns and
white spaces with the code. 
	$search_name =~ s/(\r\n?|\n)/ /g;
        $search_name =~ s/\s+$//;    # remove whitespace from end
> 
> Mike Guy


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

Date: Wed, 05 Jul 2000 09:43:49 +0100
From: Ade Talabi <adetalabi@clara.co.uk>
Subject: Re: Pattern Matching
Message-Id: <3962F545.898BD96C@clara.co.uk>

Dan Burch wrote:
> 
> I've been working on a script on my developement box (win98 running
> apache and perl5.00502).  The script reads a csv txt file, splits the
> line and tries to make a match to a vaiable that has been passed to it.
> I use a pattern match
> 
> if ( $list[2] =~ /\b$search_name\b/ )
> 
> that works perfectly on that machine, but when I loaded it to my Unix
> server(solaris running apache and perl5.00404) it it didn't make the
> match. After trying many different combination(hours of banging my head
> on my desk) and testing to see if $list[2] and $seacrh_name were actualy
> there I took a stab in the dark and added a ?.
> 
> if ( $list[2] =~ /\b$search_name?\b/)
> 
> and it worked, but I don't understand why, and that disturbs me because
> I'm not sure whats going on. I'm hoping someone can shed some light on
> this for me.
> 
> Best Regards
> Dan Burch


A happened to me before, try chomp() if this deos not work try chop(),
also print to STDOUT whatever is in $list[2] so you can track the
problem easily.

If none of the above works...

dos2unix your data file...

Any of the 3 solutions above is bound to work.
-- 
We see, whatever we want to see, whether visible or not 
- AT. June 2000.


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

Date: Sun, 09 Jul 2000 05:48:19 GMT
From: Julian Cook/Sherab Gyatso <president@webticker.com>
Subject: Pattern Matching: Replacing "+" with space
Message-Id: <3968121A.EC9D9878@webticker.com>


Hello folks,
I don't use pattern matching that much (but boy am I getting an
education in it).
My problem is this....

Where $text = "Quick+Brown+Fox"    (input from a web form)
I need to have this "Quick Brown Fox"

I have tried several ways of replacing the "+" with a space.. like the
following...

s/\+//g;   (no space between //, results in "QuickBrownFox")
s/\+/ /g;  (one space between / /, results in "Quick")
s/\+/\s/g; (results in "QuicksBrownsFox")


Anyone have any ideas how to solve this?
Many thanks for  you help in advance....

Julian


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

Date: Sun, 09 Jul 2000 01:29:36 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: Pattern Matching: Replacing "+" with space
Message-Id: <59477314EAA3BBAA.4FA57F80B273DDED.FC1388BBF26FB3AC@lp.airnews.net>

On Sun, 09 Jul 2000 05:48:19 GMT, someone claiming to be Julian
Cook/Sherab Gyatso <president@webticker.com> said:

>Where $text = "Quick+Brown+Fox"    (input from a web form)
>I need to have this "Quick Brown Fox"

>I have tried several ways of replacing the "+" with a space.. like the
>following...

>s/\+//g;   (no space between //, results in "QuickBrownFox")
>s/\+/ /g;  (one space between / /, results in "Quick")
>s/\+/\s/g; (results in "QuicksBrownsFox")

$text =~ tr/\+/ /;
print $text;


HTH
Nnickee



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

Date: 09 Jul 2000 03:03:45 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Pattern Matching: Replacing "+" with space
Message-Id: <slrn8mga02.tr3.abigail@alexandra.delanet.com>

Nnickee (nnickee@nnickee.com) wrote on MMDIV September MCMXCIII in
<URL:news:59477314EAA3BBAA.4FA57F80B273DDED.FC1388BBF26FB3AC@lp.airnews.net>:
{} On Sun, 09 Jul 2000 05:48:19 GMT, someone claiming to be Julian
{} Cook/Sherab Gyatso <president@webticker.com> said:
{} 
{} >Where $text = "Quick+Brown+Fox"    (input from a web form)
{} >I need to have this "Quick Brown Fox"
{} 
{} >I have tried several ways of replacing the "+" with a space.. like the
{} >following...
{} 
{} >s/\+//g;   (no space between //, results in "QuickBrownFox")
{} >s/\+/ /g;  (one space between / /, results in "Quick")

Really? I don't think so.

{} >s/\+/\s/g; (results in "QuicksBrownsFox")
{} 
{} $text =~ tr/\+/ /;

Why the backwack?



Abigail
-- 
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'


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

Date: Sun, 09 Jul 2000 02:12:34 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: Pattern Matching: Replacing "+" with space
Message-Id: <E9ECB69E49C75E31.2053DC022E2F515A.8D2155F09C79A24C@lp.airnews.net>

On 09 Jul 2000 03:03:45 EDT, someone claiming to be
abigail@delanet.com (Abigail) said:

>Nnickee (nnickee@nnickee.com) wrote on MMDIV September MCMXCIII in

>{} $text =~ tr/\+/ /;

>Why the backwack?

doh!
Is "cuz I'm tired" a good enough answer? :)

Nnickee



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

Date: Mon, 03 Jul 2000 13:56:21 -0700
From: Scott Chapman <scott@lund.com>
Subject: Perl & Apache Books for sale by O'Reilly! Also Python & PHP!
Message-Id: <dfv1ms4utrmqleuft44h8am11qi66l5hrt@4ax.com>

I have one each of the following books for sale in excellent
condition:

Writing Apache Modules with Perl and C $32.00
Programming Perl 2nd Edition $33.00
Perl Cookbook $30.00
Advanced Perl Programming $20.00
Learning Perl 2nd Edition $22.00

Apache The Definitive Guidew/CD $25.00

Shipping: US Mail.  Actual costs.
You tell me how fast you want 'em.

Also:
Core PHP Programming $30.00
Programming Python w/CD $30.00

Preferred payment via PayPal.  Please inquire if interested.
scott@lund.com

These prices are better than Amazon's!



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

Date: Mon, 03 Jul 2000 18:06:53 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: Perl & Apache Books for sale by O'Reilly! Also Python & PHP!
Message-Id: <39610E7D.EF7B47AA@rock13.com>

Scott Chapman wrote:
> 
> I have one each of the following books for sale in excellent
> condition:
<snip>
> These prices are better than Amazon's!

Er, Amazon's books are new and come with a return policy.
-- 

Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: Thu, 06 Jul 2000 11:01:02 -0700
From: archbishop <jbizekNOjbSPAM@hotmail.com.invalid>
Subject: Perl - internal server errors
Message-Id: <0401d13b.097e7177@usw-ex0107-050.remarq.com>

I am a new Perl programmer but need to quickly get a script that
accepts form input (using GET) and creates a new file containing that
data.  I get error #500 - Internal Server Error everytime I attempt to
run the script.  I am quite sure the script is error-free as I cut and
pasted most of it from tutorials.  Does anyone know some common causes
for such an error?  Any ideas would be appreciated....as my job my
depend on this....


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



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

Date: Thu, 06 Jul 2000 13:27:43 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Perl - internal server errors
Message-Id: <3964C18F.15F7DB11@attglobal.net>

archbishop wrote:
> 
> I am a new Perl programmer but need to quickly get a script that
> accepts form input (using GET) and creates a new file containing that
> data.  I get error #500 - Internal Server Error everytime I attempt to
> run the script.  

Take the time to read the CGI Meta FAQ, well worth the effort

http://www.smithrenaud.com/public/CGI_MetaFAQ.html

Also:

http://www.perl.com/pub/doc/FAQs/cgi/perl-cgi-faq.html

In the future, please remember to post relevant code examples and 
the specific error (found in your error log file generally).  Also,
Check out the NG comp.infosystems.www.authoring.cgi

A quick deja search on either of these groups would have saved you the
time waiting for a response on Usenet.


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

Date: Thu, 6 Jul 2000 12:35:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl - internal server errors
Message-Id: <slrn8m9da8.jc3.tadmc@magna.metronet.com>

On Thu, 06 Jul 2000 11:01:02 -0700, archbishop <jbizekNOjbSPAM@hotmail.com.invalid> wrote:

>I am a new Perl programmer but need to quickly get a script that
>accepts form input (using GET) 


Sounds like you are a new Perl programmer who happens to
be using Perl in a CGI environment.

You should use the CGI.pm module for doing CGI things.

   perldoc CGI


>and creates a new file containing that
>data.  


   perldoc -f open


>I get error #500 - Internal Server Error everytime I attempt to
>run the script.  


   perldoc -q 500


>I am quite sure the script is error-free as I cut and
>pasted most of it from tutorials.  


If your Perl is working OK, then you do not have a Perl problem.

What happens when you run it from the command line instead
of from a web server?

Have you downloaded/installed perl (it is free) on your local
computer so you can try out your programs locally?



>Does anyone know some common causes
>for such an error?  


Server configuration issues or syntax errors (have you looked
to see what was put into the server error log?).


>Any ideas would be appreciated....


Ask Perl questions in a Perl newsgroup.

Ask Server/CGI questions in a newsgroup about servers or CGI:

      comp.infosystems.www.authoring.cgi
      comp.infosystems.www.servers.mac
      comp.infosystems.www.servers.misc
      comp.infosystems.www.servers.ms-windows
      comp.infosystems.www.servers.unix


>as my job my
>depend on this....


Being able to discern which "domain" (Perl vs. CGI here) your
problem falls into, is an essential skill if you don't want
to spend lots of time looking for answers in the wrong place.

Good luck with your new job!


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


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

Date: Fri, 7 Jul 2000 09:11:59 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: Perl - internal server errors
Message-Id: <962957656.9835.0.nnrp-12.c3ad6973@news.demon.co.uk>

<snip> error #500 <snip> common causes for such an error? <snip>

many many different syntax errors.




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

Date: Thu, 6 Jul 2000 11:05:08 +0200
From: "Brendon Caligari" <brendon@shipreg.com>
Subject: perl / serial comms / win32
Message-Id: <8k1ekq$jd2$1@news.news-service.com>


using (activestate/dynamicstat) perl is it possible (and does it make
sense) to use serial comms (com1 or com2) reliably? (ability to
flexibly manipulate flow control, baud, etc)

(to: ranters - i've already checked CPAN and I've browsed
the faqs)

brendon






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

Date: 7 Jul 2000 05:11:43 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: perl / serial comms / win32
Message-Id: <slrn8mapk9.le7.efflandt@efflandt.xnet.com>

On Thu, 6 Jul 2000 11:05:08 +0200, Brendon Caligari <brendon@shipreg.com> wrote:
>
>using (activestate/dynamicstat) perl is it possible (and does it make
>sense) to use serial comms (com1 or com2) reliably? (ability to
>flexibly manipulate flow control, baud, etc)
>
>(to: ranters - i've already checked CPAN and I've browsed
>the faqs)

Have you checked out the Win32::SerialPort module?  There is also a POSIX
(Unix) port of that called Device::SerialPort.  I haven't played with it
much, but I was able to write and read results of AT commands on a modem.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Thu, 06 Jul 2000 23:41:39 GMT
From: mark.post@eds.com (Mark Post)
Subject: perl 5.005_03 on Linux fails lib/ipc_sysv.t test
Message-Id: <396518b3.43664706@news.roalok1.mi.home.com>

I am trying to build perl 5.005_03 on Linux.  The compiles all complete
successfully, but when I do the 'make test,' the ipc_sysv.t test fails.
When I run the test harness, it says that tests 5 and 6 are failing.

I ran a number of Deja searches, and couldn't find anything that would
indicate this is an acceptable result.  There wasn't anything in the FAQ
that dealt with this level of detail.

What are tests 5 and 6 actually testing?  Are these important functions?
(I have to believe so, but I just don't know enough about perl.)  What
can I do to get more information as to why these tests might be failing,
and what I might need to do to fix them?

Thanks in advance for any help.

Mark Post
Electronic Data Systems

To send me email, replace 'nospam' with 'home'.


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

Date: Fri, 07 Jul 2000 08:49:58 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl 5.005_03 on Linux fails lib/ipc_sysv.t test
Message-Id: <WQg95.1549$iP2.149913@news.dircon.co.uk>

On Thu, 06 Jul 2000 23:41:39 GMT, Mark Post Wrote:
> I am trying to build perl 5.005_03 on Linux.  The compiles all complete
> successfully, but when I do the 'make test,' the ipc_sysv.t test fails.
> When I run the test harness, it says that tests 5 and 6 are failing.
> 
> I ran a number of Deja searches, and couldn't find anything that would
> indicate this is an acceptable result.  There wasn't anything in the FAQ
> that dealt with this level of detail.
> 
> What are tests 5 and 6 actually testing?  Are these important functions?
> (I have to believe so, but I just don't know enough about perl.)  What
> can I do to get more information as to why these tests might be failing,
> and what I might need to do to fix them?


You probably have a kernel that hasnt got SysV IPC support compiled in -
you should reconfigure and rebuild your kernel and try again in the first
instance ....


/J\


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

Date: Sun, 09 Jul 2000 00:21:32 GMT
From: mark.post@eds.com (Mark Post)
Subject: Re: perl 5.005_03 on Linux fails lib/ipc_sysv.t test
Message-Id: <3967c55d.126996581@news.roalok1.mi.home.com>

On Fri, 07 Jul 2000 08:49:58 GMT, Jonathan Stowe <gellyfish@gellyfish.com>
wrote:

-snip my stuff-
>
>You probably have a kernel that hasnt got SysV IPC support compiled in -
>you should reconfigure and rebuild your kernel and try again in the first
>instance ....

No, I definitely have the IPC support selected.  That was the first thing I
checked when the tests failed.

Mark

To send me email, replace 'nospam' with 'home'.


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

Date: Mon, 03 Jul 2000 12:51:11 -0400
From: Anthony Lalande <tonyboy@earthling.net>
Subject: Perl and Locales
Message-Id: <B5863CBF.490F%tonyboy@earthling.net>

Greetings,

Perl is having trouble loading locales at startup. I get the error messages:

> warning: setlocale(LC_CTYPE, "") failed.
> warning: LC_ALL = "en_US", LC_CTYPE = "(null)", LANG = "en_US",
> warning: falling back to the "C" locale.

I have checked that the Environment variables are all properly set, and I
have:

> LC_ALL=en_US
> LANG=en_US

I know this is Perl (actually Sybperl) acting up, because the script can be
completely empty (i.e.: no command calls or anything except for the header
#!...)

My locale files all seem to be in the proper places. Does anyone have any
ideas as to what might be causing my errors or what I can do to remedy them?

Thank you,
- Anthony Lalande



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

Date: Mon, 03 Jul 2000 14:56:47 -0400
From: Anthony Lalande <tonyboy@earthling.net>
Subject: Re: Perl and Locales
Message-Id: <B5865A2E.49FF%tonyboy@earthling.net>

> Perl is having trouble loading locales at startup. I get the error messages:
> 
>> warning: setlocale(LC_CTYPE, "") failed.
>> warning: LC_ALL = "en_US", LC_CTYPE = "(null)", LANG = "en_US",
>> warning: falling back to the "C" locale.
> 
> I have checked that the Environment variables are all properly set, and I
> have:
> 
>> LC_ALL=en_US
>> LANG=en_US
> 

For those interested, here is how I solved the problem:

I found out that it was the LANG environment variable that was messing
things up, so I removed the LANG line from the /etc/sysconfig/i18n file
(after having made a backup, of course).

Now, the LANG variable doesn't load at startup, and sybperl doesn't
complain. Your mileage may vary.

- Anthony



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

Date: Sun, 09 Jul 2000 13:14:23 +1000
From: Darren Ward <dward@pla.net.au>
Subject: Perl CGI for Remote Control?
Message-Id: <3967EE0E.9503EC7@pla.net.au>

Hi All,

I'm trying to find a way to have a CGI window/frame to act as if it was
an interactive program running on the web server.

Specifically telnet and something like minicom to control a serial
device.
So it would appear that you have a shell prompt within a CGI frame and
you can type in commands etc just like normal.

So has anyone any thoughts on how to re-route a command line interface
via a CGI? Any modules?

Darren

PS Solution will be posted to the groups.



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

Date: Sun, 09 Jul 2000 07:10:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl CGI for Remote Control?
Message-Id: <smg9bot0nu65@corp.supernews.com>

Darren Ward (dward@pla.net.au) wrote:
: I'm trying to find a way to have a CGI window/frame to act as if it was
: an interactive program running on the web server.
: 
: Specifically telnet and something like minicom to control a serial
: device.
: So it would appear that you have a shell prompt within a CGI frame and
: you can type in commands etc just like normal.

Here's a shortened version of a little utility I use for exploring what
stuff I can shell out to from CGI programs.  It basically offers a
one-line command window, and sends whatever you submit to qx(), echoing
back the command and its results before offering a new input window.

Note that this is an incredibly dangerous thing to leave laying around
where anybody can stumble across it.  Using this interface, black hats
could run any arbitrary command (subject to 'nobody' permissions, if your
server is well-configured).


#!/usr/bin/perl -w
# remote.cgi - insanely dangerous CGI-as-telnet-window app for clpm.
# Craig Berry (20000708)

use strict;
use CGI qw(:all);

my $cmd = param('cmd');

print header,
      start_html('Remote terminal');
print pre(b("\$ $cmd\n"), qx($cmd)) if $cmd;
print startform(-method => 'POST',
                -action => url),
      p('$ ', input({type => 'text',
                     name => 'cmd'})),
      submit,
      endform,
      end_html;


-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

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


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