[28273] in Perl-Users-Digest
Perl-Users Digest, Issue: 9637 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 23 03:06:00 2006
Date: Wed, 23 Aug 2006 00:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 23 Aug 2006 Volume: 10 Number: 9637
Today's topics:
[ANNOUNCE] Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: extracst the first 8 bits with pack <betterdie@gmail.com>
Re: hiw do i perform this extraction <kitcha315@gmail.com>
Re: How do I run the MS Windows file search program fro axel@white-eagle.invalid.uk
Re: How do I run the MS Windows file search program fro <john@castleamber.com>
Looking for cgi script to change content based on time <danny.mcentee@gmail.com>
Re: Looking for cgi script to change content based on t <mgarrish@gmail.com>
Re: Looking for cgi script to change content based on t axel@white-eagle.invalid.uk
Re: Looking for cgi script to change content based on t usenet@DavidFilmer.com
Re: Looking for cgi script to change content based on t <tadmc@augustmail.com>
new CPAN modules on Wed Aug 23 2006 (Randal Schwartz)
Re: Permission denied trying to execute shell commands <tadmc@augustmail.com>
read file backwards kejoseph@hotmail.com
Re: read file backwards <1usa@llenroc.ude.invalid>
Re: read file backwards <ced@blv-sam-01.ca.boeing.com>
Re: Spazio utilizzato dagli utenti <john@castleamber.com>
Re: variable with empty space <tadmc@augustmail.com>
Re: variable with empty space <josef.moellers@fujitsu-siemens.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Aug 2006 04:59:35 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: [ANNOUNCE] Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1156309147@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
Maintainer: Jari Aalto A T cante net
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Unix Windows port (for Unix die-hards):
install http://www.cygwin.com/ which includes native Emacs 21.x.
and XEmacs port
o Pure Native Windows port
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/ => Emacs resource page
Emacs Perl Modules
Cperl -- Perl programming mode
http://math.berkeley.edu/~ilya/software/emacs/
by Ilya Zakharevich
CPerl is major mode for editing perl files. Also included in
latest Emacs, but newest version is at Ilya's site. Note that
the directrory at CPAN is out of date:
http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
Compared to default `perl-mode' that comes with Emacs, this
one has more features.
TinyPerl -- Perl related utilities
http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Grep through all Perl manpages (.pod)
o Follow POD references e.g. [perlre] to next pod with RETURN
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o Update `$VERSION' variable with YYYY.MMDD on save.
o Load source code into Emacs, like Devel::DProf.pm
o Prepare script (version numbering) and Upload it to PAUSE
o Generate autoload STUBS (Devel::SelfStubber) for you
Perl Module (.pm)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in Tiny Tools Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up dattabases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to to do the search, You can adjust
recursive grep options, set search case sensitivity, add user grep
options etc.
You can find latest `igrep.el' module at
<http://groups.google.com/groups?group=gnu.emacs.sources> The
maintainer is Jefin Rodgers <kevinr@ihs.com>.
TinyCompile -- To Browse grep results in Emacs *compile* buffer
TinyCompile is a minor mode for *compile* buffer from where
you can collapse unwanted lines or shorten file URLs:
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: 22 Aug 2006 22:08:38 -0700
From: "paul" <betterdie@gmail.com>
Subject: Re: extracst the first 8 bits with pack
Message-Id: <1156309718.768657.117820@74g2000cwt.googlegroups.com>
my code let user to input from the keyboard
for example user key in : 65 67 68 69
the code must be able to extract the first 8bits from each stored
number
and interprets there 8bits chunks as characters.
I don't see that your code suitable for what the requirement and as
what I already provided. Any method?
Thank
anno4000@radom.zrz.tu-berlin.de wrote:
> perlistpaul <betterdie@gmail.com> wrote in comp.lang.perl.misc:
> > Hello everyone,
> >
> > my purpose of the code is to do the following, put number into array,
>
> There is only one array, @bitplay, in your code. Nothing puts a
> number in there, your code assumes it is already set. That is
> unfortunate because we don't know what you assume it is set to.
>
> > and extracts the first 8bits from each stored number, interprets there
> > 8bits chunks as characters.
>
> By the "first" eight bits you presumably mean the lowest-numbered byte
> in the four byte sequence that make up the number. You are aware that
> the content of that byte will depend on the architecture (little/big
> endian) the program runs on.
>
> > Isn't it correct?
>
> Is what correct? Your code shows two different ways of extracting
> things from @bitplay and prints them. Both show no relationship
> to what you described above.
>
> > --------------------------------------
> > for(@bitplay)
> > {
> > $count++;
> > print pack("A6x5A1x1A1x3 s","Number","#",$count,$_),"\n";
> >
> > }
> >
> > my $str=pack("lll",@bitplay);
> >
> > print "String is ". $str."\n";
>
> This may get you started:
>
> my $n = 0x61626364; # "abcd"
> my $first_byte = substr pack( 'l', $n), 0, 1;
> print "$first_byte\n"; # "d" on little endian, "a" on big endian
>
> Anno
------------------------------
Date: 22 Aug 2006 21:09:32 -0700
From: "kitcha" <kitcha315@gmail.com>
Subject: Re: hiw do i perform this extraction
Message-Id: <1156306171.993341.46320@h48g2000cwc.googlegroups.com>
Hi Tad ,
Thanks for the script but it has some issues
I have a 1000 line document like this...
# ModelGen Info, Time 14088224 ps, Instance /tb_device/device_u1/
# 00000098 E88B01FE STMIA r11,{r1-r8}
# ModelGen Info, Time 14318056 ps, Instance /tb_device/device_u1/
# Data Write FFFFFE08
00000010
# ModelGen Info, Time 14344356 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE0C
000000A0
# ModelGen Info, Time 14370656 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE10
00000000
# ModelGen Info, Time 14396956 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE14
00000060
# ModelGen Info, Time 14423256 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE18
00000000
# ModelGen Info, Time 14449556 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE1C
00008050
# ModelGen Info, Time 14475856 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE20
00000080
# ModelGen Info, Time 14502156 ps, Instance /tb_device/device_u1/
# (seq) FFFFFE24
00000020
# ModelGen Info, Time 14509024 ps, Instance /tb_device/device_u1/
# 0000009C E3A01008 MOV r1,#8
# ModelGen Info, Time 14719424 ps, Instance /tb_device/device_u1/
# 000000A0 E3A02E1A MOV r2,#0x1a0
# ModelGen Info, Time 14929824 ps, Instance /tb_device/device_u1/
# 000000A4 E59F303C LDR r3,0xe8
# ModelGen Info, Time 15343756 ps, Instance /tb_device/device_u1/
# Data Read 000000E8
FFFFFE00
# ModelGen Info, Time 15363774 ps, Instance /tb_device/device_u1/
# 000000A8 E8830006 STMIA r3,{r1,r2}
# ModelGen Info, Time 15593606 ps, Instance /tb_device/device_u1/
# Data Write FFFFFE00
00000008
the problem is that all the characters that come after {} rnt
printed...it would be thankful if u cud explain the script to me as i m
not able to understand it..
thanks and regards,
kitcha
------------------------------
Date: Tue, 22 Aug 2006 22:57:08 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: How do I run the MS Windows file search program from html
Message-Id: <8ZLGg.7168$cw.4166@fed1read03>
In comp.lang.perl.misc Ray Muforosky <muforo@gmail.com> wrote:
> Task: I want to do file search, using the "conatining text" option from
> a web page.
> How do I search for a file on my local drive containing a certain
> string, from a web page. That is, how do run the windows search program
> from a web page.
Cygwin and grep?
AXEL
------------------------------
Date: 23 Aug 2006 01:11:22 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: How do I run the MS Windows file search program from html
Message-Id: <Xns9827CD5FC10BCcastleamber@130.133.1.4>
axel@white-eagle.invalid.uk wrote:
> In comp.lang.perl.misc Ray Muforosky <muforo@gmail.com> wrote:
>> Task: I want to do file search, using the "conatining text" option from
>> a web page.
>
>> How do I search for a file on my local drive containing a certain
>> string, from a web page. That is, how do run the windows search program
>> from a web page.
>
> Cygwin and grep?
there are native ports of grep, see:
http://johnbokma.com/mexit/2006/07/01/
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 22 Aug 2006 15:33:57 -0700
From: "danny" <danny.mcentee@gmail.com>
Subject: Looking for cgi script to change content based on time of day
Message-Id: <1156286037.768445.56990@75g2000cwc.googlegroups.com>
I'm doing a website for a radio station. They want to display an image
of the dj that is presenting at a certain time on the home page. In
other words they want a script that displays a certain image depending
on the day of the week and the time of day. Their weekly schedule
doesn't change. Any help would be great.
Thank you,
Danny.
------------------------------
Date: 22 Aug 2006 15:50:05 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Looking for cgi script to change content based on time of day
Message-Id: <1156287005.159301.132480@75g2000cwc.googlegroups.com>
danny wrote:
> I'm doing a website for a radio station. They want to display an image
> of the dj that is presenting at a certain time on the home page. In
> other words they want a script that displays a certain image depending
> on the day of the week and the time of day. Their weekly schedule
> doesn't change. Any help would be great.
>
This isn't the place to ask for pre-written code. There's jobs.perl.org
if you're in over your head and need a contractor, otherwise if you''d
explain why calling localtime and displaying an image based on the
output is causing you problems, and show what you've tried so far,
someone might be willing to help you with it.
Matt
------------------------------
Date: Tue, 22 Aug 2006 23:05:50 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Looking for cgi script to change content based on time of day
Message-Id: <i5MGg.7169$cw.1490@fed1read03>
danny <danny.mcentee@gmail.com> wrote:
> I'm doing a website for a radio station. They want to display an image
> of the dj that is presenting at a certain time on the home page. In
> other words they want a script that displays a certain image depending
> on the day of the week and the time of day. Their weekly schedule
> doesn't change. Any help would be great.
What are you willing to pay for such a script?
This is not a place to expect people to do your work for free.
If you cannot even make an effort yourself, you are in the wrong job.
Axel
------------------------------
Date: 22 Aug 2006 16:34:40 -0700
From: usenet@DavidFilmer.com
Subject: Re: Looking for cgi script to change content based on time of day
Message-Id: <1156289680.848024.49830@i3g2000cwc.googlegroups.com>
danny wrote:
> they want a script that displays a certain image depending
> on the day of the week and the time of day.
The "trick" is to decide how you will tell your program which DJ is
working which day/hour. There are LOTS of ways you can do that.
If your schedule is not very granular (ie, everything can be defined in
whole hours) you can incorporate something like this, which sacrifices
a small amount of efficiency (but over a very tiny data structure) for
something that's easy to define and easy to override for oddball
schedule changes. This creates a matrix (7 days x 24 hourly time
slots):
#!/usr/bin/perl
use strict; use warnings;
use CGI qw{ img };
my %dj_img;
foreach my $day(1..5) { #weekday schedule
map {$dj_img{$day}{$_} = 'fatguy.jpg' } ( 0.. 5); #Fred- m'night-6
map {$dj_img{$day}{$_} = 'barney.jpg' } ( 6.. 8); #Barney-morning
map {$dj_img{$day}{$_} = 'wilma.jpg' } ( 9..15); #Wilma- midday
map {$dj_img{$day}{$_} = 'betty.jpg' } (16..19); #Betty-afternoon
map {$dj_img{$day}{$_} = 'redhead.jpg' } (20..23); #Pebbles- night
}
foreach my $day(0,6) { #weekend schedule
map {$dj_img{$day}{$_} = 'bambam.jpg'} (0..9); #BamBam-w'end am
#etc.
}
# Now somewhere in our CGI script, we print the image tags:
print img( { -src => $dj_img{(localtime)[6]}{(localtime)[2]} });
# DAY HOUR
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Tue, 22 Aug 2006 22:22:32 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Looking for cgi script to change content based on time of day
Message-Id: <slrneenifo.c1q.tadmc@magna.augustmail.com>
danny <danny.mcentee@gmail.com> wrote:
> they want a script that displays a certain image depending
> on the day of the week and the time of day.
perldoc -f localtime
> Any help would be great.
You're welcome.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 23 Aug 2006 04:42:08 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Aug 23 2006
Message-Id: <J4Fp28.15uu@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-MetaSyntactic-0.88
http://search.cpan.org/~book/Acme-MetaSyntactic-0.88/
Themed metasyntactic variables names
----
Acme-Note-0.2
http://search.cpan.org/~ferreira/Acme-Note-0.2/
Make a mental note for programming style
----
Acme-Sneeze-JP-0.01
http://search.cpan.org/~miyagawa/Acme-Sneeze-JP-0.01/
Someone is talking about you
----
Benchmark-Stopwatch-0.02
http://search.cpan.org/~evdb/Benchmark-Stopwatch-0.02/
simple timing of stages of your code.
----
Benchmark-Stopwatch-0.03
http://search.cpan.org/~evdb/Benchmark-Stopwatch-0.03/
simple timing of stages of your code.
----
Carp-Indeed-0.06
http://search.cpan.org/~ferreira/Carp-Indeed-0.06/
----
Catalyst-Example-InstantCRUD-v0.0.11
http://search.cpan.org/~zby/Catalyst-Example-InstantCRUD-v0.0.11/
----
Catalyst-Example-InstantCRUD-v0.0.12
http://search.cpan.org/~zby/Catalyst-Example-InstantCRUD-v0.0.12/
----
Catalyst-Model-XML-Feed-0.01
http://search.cpan.org/~jrockway/Catalyst-Model-XML-Feed-0.01/
Use RSS/Atom feeds as a Catalyst Model
----
Class-Factory-1.04
http://search.cpan.org/~phred/Class-Factory-1.04/
Base class for dynamic factory classes
----
Config-Any-0.04
http://search.cpan.org/~rataxis/Config-Any-0.04/
Load configuration from different file formats, transparently
----
Device-Serdisp-0.06
http://search.cpan.org/~fuzz/Device-Serdisp-0.06/
Perl extension for talking to the serdisplib
----
Device-USB-MissileLauncher-0.03
http://search.cpan.org/~gmccar/Device-USB-MissileLauncher-0.03/
interface to toy USB missile launchers
----
Dict-FSA-0.1.2
http://search.cpan.org/~grousse/Dict-FSA-0.1.2/
FSA wrapper
----
Dict-Lexed-0.2.2
http://search.cpan.org/~grousse/Dict-Lexed-0.2.2/
Lexed wrapper
----
Directory-Scratch-0.06
http://search.cpan.org/~jrockway/Directory-Scratch-0.06/
Easy-to-use self-cleaning scratch space.
----
Email-Abstract-2.131
http://search.cpan.org/~rjbs/Email-Abstract-2.131/
unified interface to mail representations
----
Email-Folder-0.852
http://search.cpan.org/~rjbs/Email-Folder-0.852/
read all the messages from a folder as Email::Simple objects.
----
Email-FolderType-0.811
http://search.cpan.org/~rjbs/Email-FolderType-0.811/
determine the type of a mail folder
----
Email-MIME-1.851
http://search.cpan.org/~rjbs/Email-MIME-1.851/
Easy MIME message parsing.
----
Email-Reply-1.200
http://search.cpan.org/~rjbs/Email-Reply-1.200/
Reply to a Message
----
Email-Simple-1.980
http://search.cpan.org/~rjbs/Email-Simple-1.980/
Simple parsing of RFC2822 message format and headers
----
Email-Store-0.251
http://search.cpan.org/~rjbs/Email-Store-0.251/
Framework for database-backed email storage
----
File-Find-Object-0.0.4
http://search.cpan.org/~shlomif/File-Find-Object-0.0.4/
An object oriented File::Find replacement
----
Geo-Ellipsoid-0.904
http://search.cpan.org/~jgibson/Geo-Ellipsoid-0.904/
Calculate positions, distances, and bearings on the surface of an ellipsoid.
----
HTML-Form-ForceValue-0.005
http://search.cpan.org/~rjbs/HTML-Form-ForceValue-0.005/
who cares what values are legal, anyway?
----
Image-Caa-1.01
http://search.cpan.org/~iamcal/Image-Caa-1.01/
Colored ASCII Art
----
LaTeX-Table-v0.0.1
http://search.cpan.org/~limaone/LaTeX-Table-v0.0.1/
Perl extension for the automatic generation of LaTeX tables.
----
Lingua-Features-0.3.1
http://search.cpan.org/~grousse/Lingua-Features-0.3.1/
Natural languages features
----
Lingua-TagSet-0.3.1
http://search.cpan.org/~grousse/Lingua-TagSet-0.3.1/
Natural language tagset conversion
----
MDV-Distribconf-3.03
http://search.cpan.org/~nanardon/MDV-Distribconf-3.03/
Read and write config of a Mandriva Linux distribution tree
----
Number-Phone-1.51
http://search.cpan.org/~dcantrell/Number-Phone-1.51/
base class for Number::Phone::* modules
----
PAR-0.952
http://search.cpan.org/~smueller/PAR-0.952/
Perl Archive Toolkit
----
PAR-Repository-Client-0.04
http://search.cpan.org/~smueller/PAR-Repository-Client-0.04/
Access PAR repositories
----
PAR-Repository-Client-0.05
http://search.cpan.org/~smueller/PAR-Repository-Client-0.05/
Access PAR repositories
----
POE-Component-Client-Traceroute-0.21
http://search.cpan.org/~ahoying/POE-Component-Client-Traceroute-0.21/
A non-blocking traceroute client
----
Regexp-Log-Helix-1.03
http://search.cpan.org/~modulo/Regexp-Log-Helix-1.03/
A regular expression parser for Helix log format.
----
Regexp-Log-Helix-1.04
http://search.cpan.org/~modulo/Regexp-Log-Helix-1.04/
A regular expression parser for Helix log format.
----
Regxp-Log-Helix-1.03
http://search.cpan.org/~modulo/Regxp-Log-Helix-1.03/
----
Task-Email-PEP-All-6233.124
http://search.cpan.org/~rjbs/Task-Email-PEP-All-6233.124/
every Perl Email Project distribution, for testing
----
Task-Email-PEP-NoStore-6233.124
http://search.cpan.org/~rjbs/Task-Email-PEP-NoStore-6233.124/
every Perl Email Project distribution... except Email::Store
----
Test-AutoBuild-1.2.0
http://search.cpan.org/~danberr/Test-AutoBuild-1.2.0/
Automated build engine controller
----
Text-InHTML-v0.0.1
http://search.cpan.org/~dmuey/Text-InHTML-v0.0.1/
Display plain text in HTML
----
Text-InHTML-v0.0.2
http://search.cpan.org/~dmuey/Text-InHTML-v0.0.2/
Display plain text in HTML
----
Text-MultiMarkdown-1.0.0
http://search.cpan.org/~kulp/Text-MultiMarkdown-1.0.0/
----
Time-HiRes-1.89
http://search.cpan.org/~jhi/Time-HiRes-1.89/
High resolution alarm, sleep, gettimeofday, interval timers
----
Time-HiRes-1.90
http://search.cpan.org/~jhi/Time-HiRes-1.90/
High resolution alarm, sleep, gettimeofday, interval timers
----
Verilog-Perl-2.352
http://search.cpan.org/~wsnyder/Verilog-Perl-2.352/
----
WWW-Google-Images-0.6.3
http://search.cpan.org/~grousse/WWW-Google-Images-0.6.3/
Google Images Agent
----
WWW-Google-Images-0.6.4
http://search.cpan.org/~grousse/WWW-Google-Images-0.6.4/
Google Images Agent
----
WWW-Orphea-0.3.3
http://search.cpan.org/~grousse/WWW-Orphea-0.3.3/
Orphea Agent
----
WWW-Search-ISBNDB-0.2
http://search.cpan.org/~sock/WWW-Search-ISBNDB-0.2/
Search for book information on isbndb.com
----
XML-DOM-Lite-0.12
http://search.cpan.org/~rhundt/XML-DOM-Lite-0.12/
Lite Pure Perl XML DOM Parser Kit
----
yagg-1.4000
http://search.cpan.org/~dcoppit/yagg-1.4000/
generate a string generator from a grammar
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 22 Aug 2006 18:34:56 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Permission denied trying to execute shell commands from Perl/CGI.
Message-Id: <slrneen550.8l9.tadmc@magna.augustmail.com>
oleg106@yahoo.com <oleg106@yahoo.com> wrote:
> I just installed Apache and I am trying to call a script that should
> output some stuff to my browser. I can't get this to work at all.
> #! /usr/bin/perl -w
> print "Content-type:text/html\n\n";
^^^^
^^^^
> print `ls`;
The ls program does not output HTML...
> The screen is blank. httpd logs indicate permission denied ...
> Any idea?
Ask questions about web server configuration in a newsgroup
about web servers:
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
or a newsgroup about programming in the CGI environment:
comp.infosystems.www.authoring.cgi
> The script works just fine locally, but not via the web.
perldoc -q 500
My CGI script runs from the command line but not the browser. (500
Server Error)
> I
> tried exec and system, same deal.
Changing the Perl won't have much effect since you do not have
a Perl problem...
> User nobody has access to everything
> it needs.
Not if you are getting permission denied it doesn't.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 22 Aug 2006 18:59:04 -0700
From: kejoseph@hotmail.com
Subject: read file backwards
Message-Id: <1156298344.086249.87740@i3g2000cwc.googlegroups.com>
Hi,
I need to read a file in Perl backwards but -
I have read tips about reading the file into an array and then reading
the array in the reverse. Now, bearing in mind the fact that the log
files I will be reading will be anywhere from 10-100mb, I dont think
this is a very good idea.
I have also read about using Perl modules like FileBackwards or
File::Tie.
I do not want either of the above. I need to know whether there is a
way to read it backwards without having to use any of the above. In
other words read a file backwards using "shrink-wrapped" Perl.
Do let me know if there is any such way.
Thanks,
Kevin.
------------------------------
Date: Wed, 23 Aug 2006 02:03:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: read file backwards
Message-Id: <Xns9827E08C783D9asu1cornelledu@127.0.0.1>
kejoseph@hotmail.com wrote in news:1156298344.086249.87740@i3g2000cwc.googlegroups.com:
> Hi,
>
> I need to read a file in Perl backwards but -
>
> I have read tips about reading the file into an array and then reading
> the array in the reverse. Now, bearing in mind the fact that the log
> files I will be reading will be anywhere from 10-100mb, I dont think
> this is a very good idea.
>
> I have also read about using Perl modules like FileBackwards
There is no such module. On the other hand, File::ReadBackwards
<URL:http://search.cpan.org/~uri/File-ReadBackwards-1.04/ReadBackwards.pm>
is a fine module for the job.
> I do not want either of the above. I need to know whether there is a
> way to read it backwards without having to use any of the above. In
> other words read a file backwards using "shrink-wrapped" Perl.
>
> Do let me know if there is any such way.
Well, you can start by reading the docs for File::ReadBackwards,
see what it is doing. OTOH, this is a Pure Perl module, so I don't
see the point of not using it.
You might want to read
perldoc lib
perldoc -q lib
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 23 Aug 2006 04:46:08 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: read file backwards
Message-Id: <J4Fp8u.MxL@news.boeing.com>
kejoseph@hotmail.com wrote:
> Hi,
>
> I need to read a file in Perl backwards but -
>
> I have read tips about reading the file into an array and then reading
> the array in the reverse. Now, bearing in mind the fact that the log
> files I will be reading will be anywhere from 10-100mb, I dont think
> this is a very good idea.
>
> I have also read about using Perl modules like FileBackwards or
> File::Tie.
>
> I do not want either of the above. I need to know whether there is a
> way to read it backwards without having to use any of the above. In
> other words read a file backwards using "shrink-wrapped" Perl.
>
You could use File::ReadBackwards' strategy with seek/tell. You'll
probably learn quite a bit more than you anticipated trying to emulate
that module however :)
perldoc -f seek
perldoc -f tell
--
Charles DeRykus
------------------------------
Date: 22 Aug 2006 23:46:18 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Spazio utilizzato dagli utenti
Message-Id: <Xns9827BEF38AF48castleamber@130.133.1.4>
alessandro.mendolia@gmail.com wrote:
> #!/usr/bin/perl
> $writeout = 'find /home/Shared/* -user alessandro -ls | awk '{ print $2
> }' ' > echo FileList.txt'
>
> si arrabbia perche credo che trovi un po troppe ' (virgoletta
> singola)...
Gokje, je bedoelt dat ie zeurt over de ' ?
Gebruik
my $writeout = q(find /home/Shared/* -user alessandro -ls | awk '{ print
$2 }' ' > echo FileList.txt);
perldoc -f q
Moreover, start your script with:
#!/usr/bin/perl
use strict;
use warnings;
> Grazie a tutti!
De nada.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: Tue, 22 Aug 2006 18:29:06 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: variable with empty space
Message-Id: <slrneen4q2.8l9.tadmc@magna.augustmail.com>
usenet@DavidFilmer.com <usenet@DavidFilmer.com> wrote:
> yo wrote:
> [a multipoted question]
>
> But the bot is presently turned off....
I like "this bot" a lot better.
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 23 Aug 2006 08:35:46 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: variable with empty space
Message-Id: <ecgt32$88o$1@nntp.fujitsu-siemens.com>
yo wrote:
> hmmm i tried that althought it didnt work, im seeing the ! come
> through, at least its showing up on the logs and i can't seem to match
> that string.
You tried ... what?
Please don't top-post and please attribute replies to whatever you are=20
replying to, as " " has given you two different possible solutions and=20
now I'm to guess which one you tried ... Or did you indeed try both?
>>On Tue, 22 Aug 2006 14:20:41 -0400, wrote:
>>why didn't you try the obvious=20
>>
>> if ($username eq " !")
>>One space anywhere in the username?
>>
>>That would be (for example)
>>
>> if ($username =3D~ / /)
>>
If both solutions failed, maybe you don't have a blank in there but=20
maybe a tab.
Try
if ($username =3D~ /\s/)
(ouch, ouch, don't hit me ... yes ... leaning toothpick ...)
if ($username =3D~ m|\s|)
Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 9637
***************************************