Mark Vanmiddlesworth wrote:
>
> I want to feed the output of an "ls" command into a perl script and
> store it as a variable, but I can't seem to figure out how to do this.
> How can I get this working?
To store the results in a scalar:
my $results = `ls`;
To store the results in an array:
my
Mark VanMiddlesworth <[EMAIL PROTECTED]> writes:
> I want to feed the output of an "ls" command into a perl script and
> store it as a variable, but I can't seem to figure out how to do
> this. How can I get this working?
>
> thanks,
> mark
>
> p.s. I'm using tcsh on mac os 10.2
I now nothing abo
I want to feed the output of an "ls" command into a perl script and
store it as a variable, but I can't seem to figure out how to do this.
How can I get this working?
thanks,
mark
p.s. I'm using tcsh on mac os 10.2
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
I'm using Mac OS X (10.2), and upgraded the default installation
(5.6.0) to 5.8.0. Now, whenever I run the 'perl' command through tcsh I
get this annoying error:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG =
Hello all-
I'm trying to write a script that will upload a file from a web page and
store that file on the web server. I've snipped out the piece of code below
that's supposed to do this for me. This is running under use CGI
':standard'; use strict; and use warnings without any errors.
# $file
Hi -
> -Original Message-
> From: R. Joseph Newton [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 09, 2003 3:32 PM
> To: Troy May
> Cc: Perl List
> Subject: Re: Removing duplicates from an array
>
>
> Troy May wrote:
>
> > Hello,
> >
> > What's the best and cleanest way to remove d
reavey wrote:
> I'm interested in libraries or procedures which can produce reports
> on a mysql
> database.
The DBI module is recommended for database access. You'll need the
DBD::mysql driver module to go with it.
> I've loaded a mysql database which has powerball numbers.
> I'd like to analyze
Troy May wrote:
> Hello,
>
> What's the best and cleanest way to remove duplicates from an array? I have
> an array that reads entries from a text file and I would like to remove all
> the duplicates from it.
>
> Thanks in advance!
>
> Troy
I'd say prevention is the best cure. Check for duplica
Setup: OS Linux (Redhat 8)
Perl: 5.8.0
CPAN: 1.65
$SHELL: Bash
Anyone else here have trouble getting a command history to work with
the perl CPAN shell (perl -MCPAN -e shell)?
I have mu OS readline packages installed.
rpm -qa |grep readline
readline-4.3-3
readline-devel-4.3-3
As well as the
I'm interested in libraries or procedures which can produce reports on a
mysql
database. I've loaded a mysql database which has powerball numbers.
I'd like to analyze the data for simple things like:
Which number occurs most frequently?
Adding the winning numbers and taking their average?
Statisti
It still add record that it found on the first pass though the while loop to
my database what I need is some way to mark my file to the point that it get
to so it will not find a dupluted of the some record as the file grows. ant
ideas on how I do that.
On Sunday 09 Feb 2003 8:30 pm, Rob Dixon
From: "Troy May" <[EMAIL PROTECTED]>
> What's the best and cleanest way to remove duplicates from an array?
> I have an array that reads entries from a text file and I would like
> to remove all the duplicates from it.
Run
perldoc -q duplicate
:-)
Jenda
= [EMAIL PROTECTED] === http:/
Rob Dixon wrote:
> ...(who taught you to Capitalise
> your scalars :-? )...
Huh?!? "Taught"?? Wuzzat mean--"taught"?
~( ;- |) )
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
anthony wrote:
> Hi,
>
> But like i said on my second post i wanted to learn how to receive message
> from pipe.
>
> anthony
Hi Anthony,
That's fine. but use the pipe for it's designed purpose, which is NOT to return data
to a calling program. Try constructing your own version of "more", mayb
Hello,
What's the best and cleanest way to remove duplicates from an array? I have
an array that reads entries from a text file and I would like to remove all
the duplicates from it.
Thanks in advance!
Troy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Rob Dixon wrote:
> sub alert
> {
> seek FILEIN, 0, SEEK_SET;
>
> while( )
Of course, that should be
while ()
> {
> # does some thing on pattern matching
> }
> }
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
Benjamin Jeeves wrote:
> On Sunday 09 Feb 2003 7:23 pm, Rob Dixon wrote:
>>
>> I'm pretty sure that, as I said before, you're reading from the file
>> in several different places. The 'start' subroutiine will read the
>> first
>> line and then call 'build_db' which may well read all of the rest of
ktb wrote:
> >From the book -
> $addressbook{"Paddy Malone"} = {
> address => "23, Blue Jay Way",
> phone => "404-6599"
> };
>
> And then bring them back into the program to print out.
> Thanks,
> kent
Hi Kent,
How about "don't do it"? Look, when your text shows an assignment
"Jenda Krynicky" <[EMAIL PROTECTED]> writes:
> Tell us what OS do you have and someone will be able to give some
> more details.
Yeah, sorry. OS is linux (Redhat 8). I have both Term::ReadLine
(which is part of 5.8.0 I think and Term::ReadLine::Gnu which isn't.
I have newest CPAN-1.65 install
R. Joseph Newton wrote:
> Rob Dixon wrote:
>
>>> $filein = $ARGV[0];
>>> open(filein, "$filein");
>>
>> Filehandles are traditionally all uppercase, and it's not
>> good to put a variable in quotes unless you have a reason
>> to.
>>
>> open FILEIN, $filein;
>
> You're right, of course, about th
Benjamin Jeeves wrote:
> if I do not call build_db then alert will run fine as I want it to so
> is there away around this problem. See I need the FILEIN to go though
> a number of different sub routes how would I go about this.
Benjamin.
I'm pretty sure that, as I said before, you're reading fro
Tom Beer wrote:
> Hi,
>
> I just tried to install Spamassassin out of the FreeBSD ports.
> Even from cpan it didn't work out. After that, I tryed to download
> a package from HTML::Parser from cpan and did a make with the same results.
> Any suggestions are welcome.
>
> Please CC:' I'm currently n
Rob Dixon wrote:
> > $filein = $ARGV[0];
> > open(filein, "$filein");
>
> Filehandles are traditionally all uppercase, and it's not
> good to put a variable in quotes unless you have a reason
> to.
>
> open FILEIN, $filein;
You're right, of course, about the quotes. It seems to me that this
Hi,
But like i said on my second post i wanted to learn how to receive message
from pipe.
anthony
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
From: Harry Putnam <[EMAIL PROTECTED]>
> Should I have a cmd history with the current CPAN module?
>
> If it is something I can setup. Can someone explain how?
Yes you should, but it may depend on your OS.
Under WinNT/2k/XP it's the console that provides the history, under
Win9x you need to l
anthony wrote:
> Hi,
>
> for the while loop i figure out before your answers, anyhow, my question was
> should i send the whole array or not?
> also is it possible to retrieve the data from the pipe or not?
>
> Anthony
No and no. There are better ways than using a pipe. Pipes makes sense only w
Should I have a cmd history with the current CPAN module?
If it is something I can setup. Can someone explain how?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ktb wrote:
Is there any function that places perl code from a file into a program
as if it was just part of the program file itself?
perldoc -f use
perldoc -f require
perldoc -f eval
Will get you started. As for slurping data:
perldoc -f open
perldoc perlopentut
http://danconia.org
--
To u
On Sun, 9 Feb 2003 11:02:52 +0100, [EMAIL PROTECTED] (Anthony) wrote:
>Hi,
>
>for the while loop i figure out before your answers, anyhow, my question was
>should i send the whole array or not?
>also is it possible to retrieve the data from the pipe or not?
If you don't want to use a module like
Is there any function that places perl code from a file into a program
as if it was just part of the program file itself?
Something like:
file
**
Hello World.
**
program
$file = slurp('file');
print "$file\n":
I'm creating an address book as described on page 237 of "Beg
Hi,
I just tried to install Spamassassin out of the FreeBSD ports.
Even from cpan it didn't work out. After that, I tryed to download
a package from HTML::Parser from cpan and did a make with the same results.
Any suggestions are welcome.
Please CC:' I'm currently not subscribed!
Thanks Tom
pro
Benjamin Jeeves,
You can probably figure this out. Try running the code below supplying
whatever file name you choose to save it as for an argument.
#!/usr/bin/perl -w
use strict;
my $filein = $ARGV[0];
print "$filein\n";
open(FILEIN, $filein);
my $counter = 0;
my $counter1;
&start;
sub start
if I do not call build_db then alert will run fine as I want it to so is there
away around this problem. See I need the FILEIN to go though a number of
different sub routes how would I go about this.
On Sunday 09 Feb 2003 4:39 pm, Benjamin Jeeves wrote:
> Can someone tell me why my call to bu
Benjamin Jeeves wrote:
> Can someone tell me why my call to build_db() works but when I call
> alert() it will not work as it calls alert but will not enter the
> while loop I my opening the file with
>
> #!/usr/bin/perl
Please add these lines here:
use strict;
use warnings;
as together
On Sun, Feb 09, 2003 at 04:39:00PM +, Benjamin Jeeves wrote:
>
> Can someone tell me why my call to build_db() works but when I call alert() it
> will not work as it calls alert but will not enter the while loop I my
> opening the file with
>
> #!/usr/bin/perl
>
> $filein = $ARGV[0];
> ope
Can someone tell me why my call to build_db() works but when I call alert() it
will not work as it calls alert but will not enter the while loop I my
opening the file with
#!/usr/bin/perl
$filein = $ARGV[0];
open(filein, "$filein");
sub start
{
for(;;)
{
while
Harry Putnam wrote:
> "John W. Krahn" <[EMAIL PROTECTED]> writes:
>>>
>>> use File::Glob ':glob';
>>^^^
>> Note that the only options available are ':case', ':nocase' and
>> ':globally',
>
> Maybe it recognizes the abbrev or something. Doesn't seem to be
> wreaking havoc a
"John W. Krahn" <[EMAIL PROTECTED]> writes:
>> cat ./testglob.pl
>> #!/usr/local/bin/perl -w
>>
>> use File::Glob ':glob';
>^^^
> Note that the only options available are ':case', ':nocase' and
> ':globally',
Maybe it recognizes the abbrev or something. Doesn't seem t
Benjamin Jeeves wrote:
>
> Hi all
Hello,
> Can you help me I my tailing a growing file but in between these I execute a
> script which to has the same file as the growing file is there a way to mark
> were I got to in the file so when the file grow the script that is executed
> in the fi
Hi all
Can you help me I my tailing a growing file but in between these I execute a
script which to has the same file as the growing file is there a way to mark
were I got to in the file so when the file grow the script that is executed
in the first pass will know that start at the plac
Hi,
for the while loop i figure out before your answers, anyhow, my question was
should i send the whole array or not?
also is it possible to retrieve the data from the pipe or not?
Anthony
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
41 matches
Mail list logo