On 2012-02-11 20:33, Harry Putnam wrote:
Kevin Spencer writes:
On Fri, Feb 10, 2012 at 10:52 AM, Harry Putnam wrote:
But these command line attempts fail:
(all on one line)
perl -e 'my ($seven, $nine) =
(stat('./SweetwatterPk-016.jpg'))[7, 9];
print "$seven and $nine"'
outp
Kevin Spencer writes:
> On Fri, Feb 10, 2012 at 10:52 AM, Harry Putnam wrote:
>>
>> But these command line attempts fail:
>>
>> (all on one line)
>> perl -e 'my ($seven, $nine) =
>> (stat('./SweetwatterPk-016.jpg'))[7, 9];
>> print "$seven and $nine"'
>>
>> output:
>> syntax error a
Rob Dixon writes:
> Something like this perhaps?
>
> perl -e "print join ' and ', (stat shift)[7,9]" ./SweetwaterPk-016.jpg
Nice... yes Thanks
> But I would think the modification time (stat 9) wouldn't be of much
> use without formatting it.
In this case it was just for a quick command lin
On Fri, Feb 10, 2012 at 10:52 AM, Harry Putnam wrote:
>
> But these command line attempts fail:
>
> (all on one line)
> perl -e 'my ($seven, $nine) =
> (stat('./SweetwatterPk-016.jpg'))[7, 9];
> print "$seven and $nine"'
>
> output:
> syntax error at -e line 1, near "stat(."
> Search
On 10/02/2012 17:52, Harry Putnam wrote:
This script:
--- 8< snip -- 8< snip -- 8
Something like this perhaps?
perl -e "print join ' and ', (stat shift)[7,9]" ./SweetwaterPk-016.jpg
But I would think the modification time (stat 9) wouldn't be of much
use without format
On Thu, Sep 10, 2009 at 13:54, Gabor Szabo wrote:
snip
> There is the new perlopref document by Chas. Owens who is also on
> this list. That's great. Thanks Chas! That will be able to explain
> certain expressions such as &&.
>
> I am sure he will be happy to get some help from you.
> See http:
On Thursday 31 January 2008 20:40:13 Chas. Owens wrote:
> > How do I automate the install of a bunch of modules. Is it enough to just
> > install the tarballs, or will there be dependencies that I have to trace
> > down first? If so what is the best way to do that?
> You automate it by using the
On Jan 31, 2008 8:32 PM, Bobby <[EMAIL PROTECTED]> wrote:
snip
> Yes, thank you, but that part is old hat. What I'm looking for is if anything
> is different when I simply install the tarballs?
snip
You have to do everything yourself.
snip
> How do I automate the install of a bunch of modules. Is
On Thursday 31 January 2008 20:15:22 Chas. Owens wrote:
> On Jan 31, 2008 7:44 PM, Bobby <[EMAIL PROTECTED]> wrote:
> > On Thursday 31 January 2008 17:45:53 Chas. Owens wrote:
> > > On Jan 31, 2008 3:01 PM, Bobby <[EMAIL PROTECTED]> wrote:
> > > snip
> > >
> > > > This will be done only on brand ne
On Jan 31, 2008 7:44 PM, Bobby <[EMAIL PROTECTED]> wrote:
> On Thursday 31 January 2008 17:45:53 Chas. Owens wrote:
> > On Jan 31, 2008 3:01 PM, Bobby <[EMAIL PROTECTED]> wrote:
> > snip
> >
> > > This will be done only on brand new Slackware 12 installs which does not
> > > have CPAN.
> >
> > snip
On Thursday 31 January 2008 17:45:53 Chas. Owens wrote:
> On Jan 31, 2008 3:01 PM, Bobby <[EMAIL PROTECTED]> wrote:
> snip
>
> > This will be done only on brand new Slackware 12 installs which does not
> > have CPAN.
>
> snip
>
> That doesn't sound right. Are you certain you have Perl installed?
>
On Jan 31, 2008 3:01 PM, Bobby <[EMAIL PROTECTED]> wrote:
snip
> This will be done only on brand new Slackware 12 installs which does not have
> CPAN.
snip
That doesn't sound right. Are you certain you have Perl installed?
CPAN is part of Core Perl and should be there if Perl is installed.
Try
p
On Jun 18, 5:54 pm, [EMAIL PROTECTED] (John Degen) wrote:
> >- Original Message
> >From: Paul Lalli <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Sent: Monday, June 18, 2007 6:47:05 PM
> >Subject: Re: Command line usage
>
> >On Jun 18, 1
##I have files read into $output_dir
if ($output_dir =~ "_Modified")
{
$allfile2 = $output_dir; #set allfile2 equal to output_dir to
keep
output_dir untouched
$_ = $allfile2; #set input string equal to allfile2 for
replacement
s/_Mo
>
>
>- Original Message
>From: Paul Lalli <[EMAIL PROTECTED]>
>To: beginners@perl.org
>Sent: Monday, June 18, 2007 6:47:05 PM
>Subject: Re: Command line usage
>
>On Jun 18, 10:50 am, [EMAIL PROTECTED] (John Degen) wrote:
>
>> I think I'm
On Jun 18, 10:50 am, [EMAIL PROTECTED] (John Degen) wrote:
> I think I'm out of luck with this OS;) Your suggestion for creating a backup
> file gave the same result: no error, no change in the files. The output of
> 'perl -le"print for @ARGV" *' is * and the other is *.*. Funny though that
> sed
--
Sane sicut lux seipsam, & tenebras manifestat, sic veritas norma sui, & falsi
est. -- Spinoza
>
>
>- Original Message
>From: Paul Lalli <[EMAIL PROTECTED]>
>To: beginners@perl.org
>Sent: Monday, June 18, 2007 3:56:04 PM
>Subject: Re: Command line
On Jun 18, 8:40 am, [EMAIL PROTECTED] (John Degen) wrote:
> Thanks for your speedy reply Bob. I tried your suggestion, but the same
> outcome: the command fails without any complaints. BTW, the files didn't have
> extensions. They are three test files (plain text) containing respectively
> "love
From: Alan <[EMAIL PROTECTED]>
> It's a different case here ie not a var, instead it's a command line that's
> entered into a shell, such command line being passed to Perl. And the
> command needs to make it to Perl without getting altered before it gets to
> Perl.
>
> -s "\.
On 09/13/2006 06:07 PM, James Marks wrote:
What turned out to work — although I haven't figured out why yet — is to
to use 'acx' rather than 'aux' and to include that within the single
quotes as in:
open PS, '-|', '/bin/ps acx' or die "Cannot open pipe from ps: $!";
The above line results i
There's some reason to not use Proc::ProcessTable? It is really easy to use,
and doesnt' relies on environment variables to be used.
--
Igor Sutton Lopes
t: +55 51 9627.0779
e: [EMAIL PROTECTED]
On Sep 13, 2006, at 3:50 PM, John W. Krahn wrote:
James Marks wrote:
If I've correctly interpreted your suggested changes, the script now
reads:
-- SCRIPT --
#!/usr/bin/perl
use warnings;
use strict;
my $log_file = '/home/james/httpsd_mysqld.log';
open FILE_OUT, ">> $log_
James Marks wrote:
>
> If I've correctly interpreted your suggested changes, the script now
> reads:
>
> -- SCRIPT --
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
>
> my $log_file = '/home/james/httpsd_mysqld.log';
>
> open FILE_OUT, ">> $log_file"
> or die "Cannot
(snip)
Here's the script:
#!/usr/bin/perl
use warnings;
use strict;
my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file';
open FILE_OUT, ">> $log_file"
or die "Cannot open log file: $!";
select FILE_OUT;
(my $month, my $day, my $year, my $hour, my $minute, my $second) =
(l
On Sep 13, 2006, at 1:01 AM, Travis Thornhill wrote:
I was just looking into the %ENV hash in my trusty Programming Perl
book
and found this interesting note on p. 661:
"Note that processes running as crontab(5) entries inherit a
particularly impoverished set of environment variables. (
I was just looking into the %ENV hash in my trusty Programming Perl book
and found this interesting note on p. 661:
"Note that processes running as crontab(5) entries inherit a particularly
impoverished set of environment variables. (If your program runs fine from the
command line but not u
On Sep 13, 2006, at 12:29 AM, John W. Krahn wrote:
#!/usr/bin/perl
use warnings;
use strict;
my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file';
open FILE_OUT, ">> $log_file"
or die "Cannot open log file: $!";
select FILE_OUT;
(my $month, my $day, my $year, my $hour, my
James Marks wrote:
> Hi folks,
Hello,
> I don't know if this is a Perl or UNIX problem and I'm hoping you can
> help me figure that out.
>
> I wrote a script that checks to see if the httpsd and mysqld processes
> are running on my server and to log the results of those tests.
>
> When I run th
On Sep 12, 2006, at 11:02 PM, Mumia W. wrote:
On 09/12/2006 11:28 PM, James Marks wrote:
Hi folks,
I don't know if this is a Perl or UNIX problem and I'm hoping you can
help me figure that out.
I wrote a script that checks to see if the httpsd and mysqld
processes are running on my server an
On 09/12/2006 11:28 PM, James Marks wrote:
Hi folks,
I don't know if this is a Perl or UNIX problem and I'm hoping you can
help me figure that out.
I wrote a script that checks to see if the httpsd and mysqld processes
are running on my server and to log the results of those tests.
When I
On Sep 12, 2006, at 10:28 PM, Owen Cook wrote:
Here's the script:
#!/usr/bin/perl
use warnings;
use strict;
my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file';
open FILE_OUT, ">> $log_file"
or die "Cannot open log file: $!";
select FILE_OUT;
(my $month, my $day, my $y
On Tue, 12 Sep 2006, James Marks wrote:
>
> On Sep 12, 2006, at 9:59 PM, Owen Cook wrote:
>
> >> Here's the script:
> >>
> >> #!/usr/bin/perl
> >>
> >> use warnings;
> >> use strict;
> >>
> >> my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file';
> >>
> >> open FILE_OUT, ">> $log_
On Sep 12, 2006, at 9:59 PM, Owen Cook wrote:
Here's the script:
#!/usr/bin/perl
use warnings;
use strict;
my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file';
open FILE_OUT, ">> $log_file"
or die "Cannot open log file: $!";
select FILE_OUT;
(my $month, my $day, my $ye
On Tue, 12 Sep 2006, James Marks wrote:
> Hi folks,
>
> I don't know if this is a Perl or UNIX problem and I'm hoping you can
> help me figure that out.
>
> I wrote a script that checks to see if the httpsd and mysqld processes
> are running on my server and to log the results of those tests.
>
>I want to run an image conversion program to rotate the contents of an
>entire directory.
>
>This is run as thus:
>
>
>"jpegtran -rotate 90 *.jpg"
>
>
>The problem is that I need to specify the filename for each converted
>image. Is there some command which 'takes' the value of the file for
On 4/8/06, Max von Seibold <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I want to run an image conversion program to rotate the contents of an
> entire directory.
>
> This is run as thus:
>
>
> "jpegtran -rotate 90 *.jpg"
>
>
> The problem is that I need to specify the filename for each converted
> imag
On 4/13/05, John Doe <[EMAIL PROTECTED]> wrote:
> Am Mittwoch, 13. April 2005 10.46 schrieb Ramprasad A Padmanabhan:
> > On Wed, 2005-04-13 at 12:32, Thomas Bätzler wrote:
> > > Ramprasad A Padmanabhan <[EMAIL PROTECTED]> asked:
> > > > I want to write a perl script like "gnu less".
> > > >
> > > >
Ramprasad A Padmanabhan wrote:
I want to write a perl script like "gnu less".
My perl script accepts input on STDIN or filename(s) as arguments.
If both are missing it should print the error message. How do I do this
?
The pseudocode will be
--
IF INPUT ON STDIN ;then
Process ST
Am Mittwoch, 13. April 2005 10.46 schrieb Ramprasad A Padmanabhan:
> On Wed, 2005-04-13 at 12:32, Thomas BÃtzler wrote:
> > Ramprasad A Padmanabhan <[EMAIL PROTECTED]> asked:
> > > I want to write a perl script like "gnu less".
> > >
> > > My perl script accepts input on STDIN or filename(s) as arg
On Wed, 2005-04-13 at 12:32, Thomas BÃtzler wrote:
> Ramprasad A Padmanabhan <[EMAIL PROTECTED]> asked:
> > I want to write a perl script like "gnu less".
> >
> > My perl script accepts input on STDIN or filename(s) as arguments.
> > If both are missing it should print the error message. How do
Ramprasad A Padmanabhan <[EMAIL PROTECTED]> asked:
> I want to write a perl script like "gnu less".
>
> My perl script accepts input on STDIN or filename(s) as arguments.
> If both are missing it should print the error message. How do
> I do this ?
There is always input on STDIN - even a straig
Ramprasad A Padmanabhan wrote:
Quick question,
I want to run
perl -ane '/REMARKS/ && print $F[1]' FILE1 FILE2
the problem is that there is no newline at the end of the every print.
so I have to do
perl -ane '/REMARKS/ && print $F[1] . "\n"' FILE1 FILE2
I thought there is a switch in
>
> Afternoon all, I have a script that runs from the command line but now I
> need it to from from the web, anyone know how to do this?
>
> All the script does is write files so output to the screen isn't
important.
> It needs to run from the web because there will be a form on a web
page an
-Original Message-
From: Graeme McLaren [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 10:13 AM
To: [EMAIL PROTECTED]
Subject: command line script to run from web
Afternoon all, I have a script that runs from the command line but now I
need it to from from the web, anyone know
-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
Sent: Friday, April 16, 2004 4:59 PM
To: ewalker
Cc: [EMAIL PROTECTED]
Subject: Re: command line options
[EMAIL PROTECTED] wrote:
> Hey guys anyone have any examples of how to check options with the Get::Lon
[EMAIL PROTECTED] wrote:
Hey guys anyone have any examples of how to check options with the Get::Long module.
Here is what I used to get the options. I need examples of how to check to see if they
entered the correct things or not.
&GetOptions('h|usage|help|info', 'p=s', 's=s', 't=s');
I posted a
On Dec 31, 2003, at 8:22 AM, Randy Brown wrote:
Ah yes, now the real stumper:
The line:
perl -pi -e 's/file:.*<\/provider-url>/REPLACED/'
testfile.txt
does in fact work fine from the commandline in unix.
However, when it is called from a ksh script, it does not function.
Any ideas? I have trie
tions that I can think of.
Thanks very much.
Randy
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 7:04 PM
To: Perl Beginners Mailing List
Subject: Re: command line search and replace
On Dec 30, 2003, at 4:51 PM, Randy Brown wrote:
> When
On Dec 30, 2003, at 4:51 PM, Randy Brown wrote:
When I try the following, perl reads the * as a literal character,
instead of my intent as a global value. Anyone see what I am missing?
perl -pi -e "s/file:*<\/provider-url>/REPLACED/g"
testfile.txt
you might want to revisit
perldoc perlretut
IMHO, parsing command-line options sounds a lot easier than it is.
Definitely use the modules unless you have a good reason for not doing
so. The author(s) of the module have probably already dealt with the
forehead-slappers that might not be obvious right off the bat, and it
will save you a lot
Ben Crane wrote:
>
> Hi all,
Hello,
> Sorry, should have added this to my last email. Does
> anyone know how to pass values to a perl script
> through the command line? Do you use param as in CGI
> scripting/
>
> I want a user to be able to specify certain parameters
> for the perl script (in c
On Dec 9, 2003, at 8:38 AM, Paul Kraus wrote:
[..]
Nameofperlscript command1 command2 command3
Params stored in global variable @ARGV
ben,
the alternative of course is to look into
perldoc Getopt::Long
where you can do many majical voodoo with...
Oh dear, just found my old DOG about getopt
You should use this: testscript.pl blah
where blah is the value to pass.
Ben Crane wrote:
Hi all,
Sorry, should have added this to my last email. Does
anyone know how to pass values to a perl script
through the command line? Do you use param as in CGI
scripting/
I want a user to be able to s
Nameofperlscript command1 command2 command3
Params stored in global variable @ARGV
> -Original Message-
> From: Ben Crane [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 09, 2003 11:23 AM
> To: [EMAIL PROTECTED]
> Subject: command line commands passed to perl script?
>
>
> Hi all
On Dec 1, 2003, at 3:41 AM, Manish Uskaikar wrote:
I want to do a simple search replace on a unix command prompt.
What i require is a syntax to do is?
echo "I am Manish"|
output I am Jeff.
jeff,
I am drieux.
What I would recommend is something old school,
in which you go with something like c
On Dec 1, 2003, at 8:06 AM, Ramprasad A Padmanabhan wrote:
There must be a better way but what comes to my mind is
echo "I am Manish" | perl -e 'while(<>){ s/Manish/Jeff/g ; print "$_"}'
echo "I am Manish" | perl -pe 's/Manish/Jeff/g'
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
Manish Uskaikar wrote:
Hi,
I want to do a simple search replace on a unix command prompt. What i require is a
syntax to do is?
echo "I am Manish"|
output I am Jeff.
Please help.
Regards
Manish U
--
The information contained in this message is confidential and prop
On Thursday, Nov 27, 2003, at 17:49 US/Pacific, John W. Krahn wrote:
Philipp Traeder wrote:
[..]
If I am not mistaken, this is more or less exactly what I am doing
right
now - the only problem I have got with this is that the user is
interrupted in his work when the 'long_action' finishes - like t
Philipp Traeder wrote:
Hi Phillip,
Sorry. That last example cheated with a long, hard-coded wait. Below is
something that speaks a little more closely to the problem.
...
> b) How can I set up the ReadLine() part in a way that the user is able
> to type new actions, but can receive new message
Philipp Traeder wrote:
>
...
> b) How can I set up the ReadLine() part in a way that the user is able
> to type new actions, but can receive new messages (from finished long
> actions) as well? I have played around with Term::ReadKey, and ended up
> with something like this:
Are you looking for
Philipp Traeder wrote:
>
> > It is pretty simple, the perlipc man page has some good examples, but it
> > is basically like this:
> >
> > elsif ( $cmd eq 'long_action' ) {
> > defined( my $pid = fork ) or die "Cannot fork: $!";
> > unless ( $pid ) {
> > # execute th
On Thursday, Nov 27, 2003, at 14:10 US/Pacific, Philipp Traeder wrote:
[..]
The danger of primates banging on keyboards is - of course - always
existent and quite high, but in this case I would settle for a first
version that would be usable by more or less normal beings of the
species homo [EMAIL
> Not related to your question but, have you thought of using a dispatch
> table instead?
>
> sub help {
> # process help
> }
>
> sub long_action {
> # process long_action
> }
>
> my %process = (
> help=> \&help,
> long_action => \&long_action,
> simple_cmd =
On Thu, 2003-11-27 at 21:37, drieux wrote:
>
> On Thursday, Nov 27, 2003, at 09:58 US/Pacific, Douglas Lentz wrote:
>
> > Re: (A) What's the best way for the child to inform the parent that
> > it's done?.
> >
> Given that his question (A) is about 'informing'
> the parent that it is finished, h
Philipp Traeder wrote:
>
> Good morning everybody,
Hello,
> I am writing a small console application, allowing the user to perform
> some actions via a shell-like interface. The basics of this were rather
> easy, and with the help of some very nice CPAN modules (i.e.
> Base::Shell), I have got t
On Thursday, Nov 27, 2003, at 09:58 US/Pacific, Douglas Lentz wrote:
Philipp Traeder wrote:
Good morning everybody,
[..]
# ...
elsif ($cmd eq 'long_action') {
if (!fork) {
# execute the action in the child process
sleep 10;
# TODO: noti
Philipp Traeder wrote:
Good morning everybody,
I am writing a small console application, allowing the user to perform
some actions via a shell-like interface. The basics of this were rather
easy, and with the help of some very nice CPAN modules (i.e.
Base::Shell), I have got tab-completion, a hel
On Saturday, Nov 1, 2003, at 18:40 Europe/Brussels, Jeff Westman wrote:
SilverFox <[EMAIL PROTECTED]> wrote:
hey guys, i'm trying to grep some data from a log file and getting the
following error. Any ideas???
[EMAIL PROTECTED] perl -e 'grep \"Eliminating movie\" update.log |awk
{'print
\$5'}';
SilverFox <[EMAIL PROTECTED]> wrote:
> hey guys, i'm trying to grep some data from a log file and getting the
> following error. Any ideas???
>
> [EMAIL PROTECTED] perl -e 'grep \"Eliminating movie\" update.log |awk {'print
> \$5'}';
>
> Can't find string terminator '"' anywhere before EOF at -
On Sat, Nov 01, 2003 at 11:02:25AM -0500, SilverFox wrote:
> hey guys, i'm trying to grep some data from a log file and getting the
> following error. Any ideas???
>
> [EMAIL PROTECTED] perl -e 'grep \"Eliminating movie\" update.log |awk {'print
> \$5'}';
% awk '/Eliminating movie/ { print $5
On Mon, 7 Jul 2003 21:19:19 -0400, [EMAIL PROTECTED] (Zeus Odin)
wrote:
>I have written an interface for m-w.com. I found some scripts on the web but
>nothing really robust. Please have a look, make comments, request
>functionality, make suggestions, make changes, or anything else you feel
>useful
Madhu Reddy wrote:
> Hi,
> I want to pass command line arguements to perl
> program ?
> How to do this ?
There's Getopt::Std and Getopt::Long. IMHO the Getopt::Long interface and
how it accesses the command line options is superior to Getopt::Std and
supports both short (-t) and long (--type
Madhu Reddy wrote:
> Hi,
> I want to pass command line arguements to perl
> program ?
> How to do this ?
>
Perl stores args passed to your script at @ARGV. you could check what's
there by looking at this array like:
#!/usr/bin/perl -w
use strict;
#--
#-- cat.pl
#--
while(@ARGV){
pri
David Olbersen
iGuard Engineer
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 02, 2003 3:16 PM
> To: Madhu Reddy; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: R
> Hi,
> I want to pass command line arguements to perl
> program ?
> How to do this ?
There's also modules if it's a complicated list of command options.
Not sure of the name exactly, just go to search.cpan.org and take a look.
DMuey
>
> Thanks
> -Madhu
>
>
>
> Hi,
> I want to pass command line arguements to perl
> program ?
> How to do this ?
They are stored in an array named @ARGV
So ./script.pl -q
You'd say ::
if(defined $ARGV[0] && $ARGV[0] =~ m/^-q$/) { print "I am Q!\n"; }
>
> Thanks
> -Madhu
>
>
> __
--- Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Tue, Feb 11, 2003 at 09:45:32AM -0800, Jeff Westman wrote:
>
> > This seems simple enough, but I can't get it to work.
> >
> > I want to print out the cross-reference AND parsed version of a script.
> I
> > can only get one of the modules at a ti
On Tue, Feb 11, 2003 at 09:45:32AM -0800, Jeff Westman wrote:
> This seems simple enough, but I can't get it to work.
>
> I want to print out the cross-reference AND parsed version of a script. I
> can only get one of the modules at a time to work -- not both.
>
> I have tried:
>
> perl -Mmodu
If you have the Perl Cookbook, check 15.10 on pages 529 and 530.
You can use the Term::Readkey from CPAN.
use Term::Readkey;
ReadMode('noecho');
$password = ReadLine(0);
That's the brief example they gave. A more elaborate example is in the book.
-Original Message-
From: Richard Low
> -Original Message-
> From: Richard Lowe [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 5:57 AM
> To: [EMAIL PROTECTED]
> Subject: Command line Password
>
>
> Hi,
>
> I'm trying to read in a password from the command prompt, but
> want to either
> mask the typed characters
On Thursday, July 25, 2002, at 02:57 , Richard Lowe wrote:
> The systems I'm using are Win32, and I'd rather not have to use any CPAN
> modules - I've been looking into tied filehandles, but can't work out
> what's
> required in the subroutines.
I presume that you are doing this in a 'dos comm
On Sunday, June 30, 2002, at 10:14 , Ankit Gupta wrote:
[..]
> I was trying the following through command line
>
> c:\> perl abc.pl folder1\folder2 folder3\folder4
>
> but in script I am just able to get folder1\folder2 where as I need both
> folder1\folder2 and folder3\folder4 separately i
On Friday, May 24, 2002, at 07:42 , Torres, Jose wrote:
> Here's the code I currently have to do this:
>
> $startDir = $ARGV[0];
>
> ## Main Program ##
> $dir = ();
> opendir (DIR, $startDir);
> foreach $dir (readdir(DIR)) {
> if(($dir ne ".") && ($dir ne "..")){
> CreateChec
Here's the code I currently have to do this:
$startDir = $ARGV[0];
## Main Program ##
$dir = ();
opendir (DIR, $startDir);
foreach $dir (readdir(DIR)) {
if(($dir ne ".") && ($dir ne "..")){
CreateChecksum($dir);
}
}
closedir DIR;
sub CreateChecksum {
my($
On Thursday, May 23, 2002, at 01:45 , Torres, Jose wrote:
> what Perl function can I used to invoke something usually done at the
> command line?
> I want to execute:
>
> sum * > SNP/020405/foo.txt
>
> this will call checksum on everything and output to foo.txt in
> /SNP/020405.
> Problem is, t
"John W. Krahn" wrote:
>
> This should give you some ideas on how to do it
>
> use warnings;
> use strict;
> use File::Find;
>
> my %files;
> find( sub {
> # put all .doc files in the hash
> push @{$files{$File::Find::dir}}, $File::Find::name if /\.doc$/i
> # get the directory name
Jose Torres wrote:
>
> Hi,
Hello,
> I have a directory with several subdirectories, each full of several dozen
> Word files. For each subdirectory, I need to run the checksum app against
> all of that directory's files and output a file into that directory with the
> checksum results. How can
what Perl function can I used to invoke something usually done at the
command line?
I want to execute:
sum * > SNP/020405/foo.txt
this will call checksum on everything and output to foo.txt in /SNP/020405.
Problem is, the * will sum all files in the current directory, not those in
SNP/020405. So
Whoa!! Perl was not meant to make you work so hard!!
For changing directory...used function chdir (perldoc -f chdir)
For getting teh directories...well
opendir (DIR,"$myCurDir");
foreach (readir(DIR)) {
if (-d $_) {
Change to the directory
}
}
Probably you an use recursion t
Thanks everyone for your help. It is much appreciated.
-Original Message-
From: David vd Geer Inhuur tbv IPlib
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 12:39 PM
To: [EMAIL PROTECTED]; Torres, Jose
Subject: Re: command-line commands within a Perl script
Hi,
A possible
Hi,
A possible way :
#---
use File::Find;
use File::stat;
my $directory = "/user/IPlib/IPlib/";
find(\&search, $directory);
}
sub search() {
my $file = $File::Find::name || shift;
if ( -d $file ) { push @dirs,$file; }
else { push @files,$file; }
print @files;
print @dir
If you do that, you will be invoking the shell, changing the current
directory for the shell, and then closing the shell. What you want is to
use the chdir() Perl function to change the current directory of your Perl
script.
perldoc -f chdir
-Original Message-
From: Torres, Jose
To:
From: Nikola Janceski <[EMAIL PROTECTED]>
> Is there a way to get the command line arguments before they are
> expanded by the shell?
>
> script.pl file* names*
>
> I want to get the file* and not the expanded list of file1 file2 file3
> file4 etc.
>
> I know I can put it in quotes but is ther
--Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 5:08 PM
To: Hanson, Robert; Nikola Janceski; Beginners (E-mail)
Subject: RE: command line arguments
I was hoping for some way to capture it in perl instead with out having to
change the co
> "Nikola" == Nikola Janceski <[EMAIL PROTECTED]> writes:
Nikola> Is there a way to get the command line arguments before they
Nikola> are expanded by the shell?
Nope. Perl simply doesn't get to see them. It's part of your
interaction with the shell.
Nikola> I know I can put i
I was hoping for some way to capture it in perl instead with out having to
change the command line arguments.
-Original Message-
From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 5:05 PM
To: 'Nikola Janceski'; Beginners (E-mail)
Subject: RE: co
You should be able to just escape the *. Single quoting them should also
work.
script.pl file\* names\*
script.pl 'file*' 'names*'
Rob
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 5:03 PM
To: Beginners (E-mail)
Subject: command lin
On Mon, Feb 11, 2002 at 02:11:09PM -0500, Balint, Jess wrote:
> What is the deal behind this 'package vars' vs 'lexical vars'. I have used
> (my) to declare variables in the past and was wondering what the difference
> was between these two declarations. Thanks.
I'm surprised no one has answered
[EMAIL PROTECTED] wrote:
>
> This script gives me nothing:
>
> #!/usr/bin/perl -F/\t/ -ap
>
> print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 1816;
^
> print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 5380;
What shell are you using? Std Dos Commmand or something else? Within
definition or assignment of pl to perl, it should look something like:
File types should have Open: D:\Perl\bin\Perl.exe "%1" %*
Under one build of ActiveState, there were a number of problems in this area
concerning
1 - 100 of 132 matches
Mail list logo