Hi all,
On Mon, 20 Apr 2015 17:02:22 -0500
Andy Bach wrote:
> On Mon, Apr 20, 2015 at 3:32 PM, Frank K. wrote:
>
> > Would someone suggest a solution which would allow me to “open” a
> > read/write session to a command line??
>
>
> perlfaq8.pod
>How can I
On Mon, Apr 20, 2015 at 3:32 PM, Frank K. wrote:
> Would someone suggest a solution which would allow me to “open” a
> read/write session to a command line??
perlfaq8.pod
How can I open a pipe both to and from a command?
The IPC::Open2 module (part of the standard perl distri
write several commands to the handle and read the output of each
command..
Would someone suggest a solution which would allow me to "open" a read/write
session to a command line??
Thanks in advance.. flk k
o
such mechanism exists for cmd.exe that I am aware of. %* is
substituted for the command line arguments, but they aren't
quoted or escaped so they are not preserved. You could hard-code
up to 9 arguments with "%1" "%2" ... "%n", but then you'll be
passing always
I overlooked the missing single quotes, Thanks!
-Jon
e
matches). Something like:
perl -p -i.bak -e 's/PATTERN/REPLACE/g' INPUT
Hi Jon
Backslashes within a single-quoted command-line string don't need
escaping, so a single backslash before each parenthesis is correct.
But from your output it seems you have omitted the single-q
On 12-05-31 01:23 PM, Jon Forsyth wrote:
Hello,
I'm using the following line in Terminal, on OSX Lion, but I can't seem to
match parentheses '()':
perl -n -e 'print if(/\\(Submit\\)/)' visits/admin_add.ctp
I tried with one backslash in front of each '(' ')' as well to no avail.
If I remove t
Hello,
I'm using the following line in Terminal, on OSX Lion, but I can't seem to
match parentheses '()':
perl -n -e 'print if(/\\(Submit\\)/)' visits/admin_add.ctp
I tried with one backslash in front of each '(' ')' as well to no avail.
If I remove the '\'s and '()' the match is printed like s
Thanks for both of you.
Your guys are great.
Best regards,
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Sat, Mar 3, 2012 at 9:08 AM, lina wrote:
> $ perl extract.pl try.tex
> Bareword "filename" not allowed while "strict subs" in use at extract.pl line
> 8.
> Execution of extract.pl aborted due to compilation errors.
>
>
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
>
> my $filename = $A
On 2012-03-03 09:08, lina wrote:
$ perl extract.pl try.tex
Bareword "filename" not allowed while "strict subs" in use at extract.pl line 8.
Execution of extract.pl aborted due to compilation errors.
#!/usr/bin/env perl
use strict;
use warnings;
Good.
my $filename = $ARGV[0] ;
open FILE, "
$ perl extract.pl try.tex
Bareword "filename" not allowed while "strict subs" in use at extract.pl line 8.
Execution of extract.pl aborted due to compilation errors.
#!/usr/bin/env perl
use strict;
use warnings;
my $filename = $ARGV[0] ;
open FILE, "<", filename or die $!;
my @line = ;
whil
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 &q
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];
>>
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 t
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"'
&
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
This script:
--- 8< snip -- 8< snip -- 8http://learn.perl.org/
W dniu 2011-05-24 06:11, vishesh kumar pisze:
Hi Members,
I am a linux system admin. I want to use perl as a command line like sed
and awk.
generally, you might be interested in http://minimalperl.com/.
HTH
Irek
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
Thanks Jim
Now i understood completely. Very good explanation.
On Fri, May 27, 2011 at 10:45 AM, Jim Gibson wrote:
> At 10:28 AM +0530 5/27/11, vishesh kumar wrote:
>
>> Hi Jim
>>
>
> You should address all of your questions to the list as a whole. That way
> you will get smarter people than
At 10:28 AM +0530 5/27/11, vishesh kumar wrote:
Hi Jim
You should address all of your questions to the list as a whole. That
way you will get smarter people than me helping you.
echo $str | perl -pe 's/.*?(\d+\.[\d.]+).*/$1/'
Giving desired result, but i wonder what is use of ? in this exp
linux system admin. I want to use perl as a command line like sed
>> and awk.
>> For example suppose , i need to extract IP Addr from a string or file
>> using
>> regrex
>> i mean
>> str="hello ip is 192.168.2.1 and data is xxx"
>> And i want ip
Thanks Jim
Your suggestion working great !!!
On Tue, May 24, 2011 at 11:59 AM, Jim Gibson wrote:
> echo $str | perl -pe 's/.*?(\d+\.[\d.]+).*/$1/'
--
http://linuxmantra.com
Hi Vishesh,
On Tuesday 24 May 2011 07:11:45 vishesh kumar wrote:
> Hi Members,
>
> I am a linux system admin. I want to use perl as a command line like sed
> and awk.
> For example suppose , i need to extract IP Addr from a string or file using
> regrex
> i mean
At 9:41 AM +0530 5/24/11, vishesh kumar wrote:
Hi Members,
I am a linux system admin. I want to use perl as a command line like sed
and awk.
For example suppose , i need to extract IP Addr from a string or file using
regrex
i mean
str="hello ip is 192.168.2.1 and data is xxx"
And
Hi Members,
I am a linux system admin. I want to use perl as a command line like sed
and awk.
For example suppose , i need to extract IP Addr from a string or file using
regrex
i mean
str="hello ip is 192.168.2.1 and data is xxx"
And i want ip addr only using Regex
echo $str
?
> >
> > mail_smtp.pl
> > -r
> > ${MAILFROM}
> > -s
> > "$subject_line TEST EMAIL"
> > supportm...@test.com
> > <
> > /tmp/test_email.txt
>
> Just to clarify the end of the command line:
>
> mail_smtp.pl -r ${MAILFROM}
On Wed, Jul 21, 2010 at 1:17 PM, newbie01 perl wrote:
> Does $_ contains the following values on each iteration?
>
> mail_smtp.pl
> -r
> ${MAILFROM}
> -s
> "$subject_line TEST EMAIL"
> supportm...@test.com
> <
> /tmp/test_email.txt
Just to clarify th
"$subject_line TEST EMAIL"
supportm...@test.com< /tmp/test_email.txt
The Perl script is working and SMTP mail is working. Am just trying to
understand how the getval sub-routine is parsing the command line arguments.
the getval subroutin
led from a
> UNIX Korn script as below:
>
> mail_smtp.pl -r ${MAILFROM} -s "$subject_line TEST EMAIL"
> supportm...@test.com < /tmp/test_email.txt
>
> The Perl script is working and SMTP mail is working. Am just trying to
> understand how the getval sub-routine is par
EMAIL"
supportm...@test.com < /tmp/test_email.txt
The Perl script is working and SMTP mail is working. Am just trying to
understand how the getval sub-routine is parsing the command line arguments.
the getval subroutine is as below.
>I need to pass an command-line arg that is a string which contains the '@'.
Is there any way to do this and also 'tell' Perl not to interpret this as
other than a '@' character?
>
>Thx.
Hi,
Perl would not do anything with command-line arguments unle
On 12/9/09 Wed Dec 9, 2009 6:01 PM, "Tony Esposito"
scribbled:
> I need to pass an command-line arg that is a string which contains the '@'.
> Is there any way to do this and also 'tell' Perl not to interpret this as
> other than a '@' char
I need to pass an command-line arg that is a string which contains the '@'. Is
there any way to do this and also 'tell' Perl not to interpret this as other
than a '@' character?
Thx.
OK thank you both, I got it.
2009/11/6 Shawn H Corey :
> 兰花仙子 wrote:
>> Hello,
>>
>> doesn't one-liner Perl command support __DATA__ handler?
>> Just found this:
>>
>> # perl -e 'while(){ print }
>>> __DATA__
>>> abc
>>> 123
>>> def
>>> '
>>
>> run without any output.
>>
>
>
> $ perl -MO=Deparse -
兰花仙子 wrote:
> Hello,
>
> doesn't one-liner Perl command support __DATA__ handler?
> Just found this:
>
> # perl -e 'while(){ print }
>> __DATA__
>> abc
>> 123
>> def
>> '
>
> run without any output.
>
$ perl -MO=Deparse -e 'while(){ print }
>> __DATA__
>> abc
>> '
while (defined($_ = )) {
À¼»¨ÏÉ×Ó wrote:
Hello,
Hello,
doesn't one-liner Perl command support __DATA__ handler?
No. It only works in an actual file located on a real file system.
Just found this:
# perl -e 'while(){ print }
__DATA__
abc
123
def
'
run without any output.
You could always do it like this:
Hello,
doesn't one-liner Perl command support __DATA__ handler?
Just found this:
# perl -e 'while(){ print }
> __DATA__
> abc
> 123
> def
> '
run without any output.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.
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:
e -v option:
perldoc -v '$.'
and I think on windows it needs to be
perldoc -v "$."
but of course most of the windows people will freak out if they need to
use the command line and I don't blame them. I hate to use the Windows
command shell as well.
That's an
On Thu, May 21, 2009 at 12:44, Tony Esposito wrote:
> Hello,
>
> Given the command line:
>
> perl myperl.plx < myfile.txt
>
> is there anyway from within the Perl script to capture the redirected STDIN
> filename (i.e., myfile.txt)?
>
> OS: WinXP SPSP3
Hello,
Given the command line:
perl myperl.plx < myfile.txt
is there anyway from within the Perl script to capture the redirected STDIN
filename (i.e., myfile.txt)?
OS: WinXP SPSP3
Perl: 5.8.8 for Win32 from ActiveState
Thx.
On Fri, Nov 28, 2008 at 22:21, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
>>
>> On Fri, Nov 28, 2008 at 10:28, John W. Krahn <[EMAIL PROTECTED]> wrote:
>> snip
>>>
>>> perl -le'@chars = 33 .. 126; print map chr $chars[ rand @chars ], 1 .. 8'
>>
>> snip
>>
>> Perl Golf time:
>>
>>
Chas. Owens wrote:
On Fri, Nov 28, 2008 at 10:28, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
perl -le'@chars = 33 .. 126; print map chr $chars[ rand @chars ], 1 .. 8'
snip
Perl Golf time:
perl -le'print map chr+(33..126)[rand 94],1..8'
$ perl -le'print map chr+(33..126)[rand 94],1..8'
Wa
On Fri, Nov 28, 2008 at 10:28, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
> perl -le'@chars = 33 .. 126; print map chr $chars[ rand @chars ], 1 .. 8'
snip
Perl Golf time:
perl -le'print map chr+(33..126)[rand 94],1..8'
--
Chas. Owens
wonkden.net
The most important skill a programmer can have
On Thu, Nov 27, 2008 at 15:04, Yimin Rong <[EMAIL PROTECTED]> wrote:
> wget -q -O - "http://random.org/integers/?
> num=8&min=33&max=126&col=8&base=16&format=plain&rnd=new" | perl -ne
> 'foreach (split(/\t/, $_)) {print chr(hex($_));} print "\n"'
>
> wget reads web pages
> random.org generates rand
Yimin Rong wrote:
wget -q -O - "http://random.org/integers/?
num=8&min=33&max=126&col=8&base=16&format=plain&rnd=new" | perl -ne
'foreach (split(/\t/, $_)) {print chr(hex($_));} print "\n"'
You can simplify the perl part to:
perl -lane'print map chr hex, @F'
Or just using perl:
perl -MLWP::
wget -q -O - "http://random.org/integers/?
num=8&min=33&max=126&col=8&base=16&format=plain&rnd=new" | perl -ne
'foreach (split(/\t/, $_)) {print chr(hex($_));} print "\n"'
wget reads web pages
random.org generates random numbers using atmospheric noise
perl splits the input into tokens and convert
And here is the createEnvelope function:
#
# Functions listed below are internal to the creation of the custom
SOAP requests.
#
sub createEnvelope {
my $action = shift;
my $namesp = shift;
my $params = shift;
my $soap = '
http://www.w3.org/2001/
XMLSchema-instance"
Jack Trinh (jtrinh) wrote:
>
> SE CORRECT THEM FOR ME.
> Thanks
> JACK
Hush
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
SE CORRECT THEM FOR ME.
Thanks
JACK
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2008 05:15 PM Pacific Standard Time
To: beginners@perl.org
Subject:Re: Unix command-line tools to edit SharePoint site?
Kelley,
I just
Kelley,
I just completed a project had to figure out how to create SharePoint
calendar events from Perl. This was quite a chore, as MS's SOAP
interface does not adhere to open standards. As such, I had to create
my own custom SOAP requests that contained MS's CAML query language.
See the example
I begrudgingly use a Windows SharePoint server at a customer's request.
I'd like to automate (command-line) updating and creating documents,
lists, etc.
Is there a Unix tool that does this?
I know SharePoint has an "API", which basically spoofs the GET/POST
calls that you
On Thu, Apr 24, 2008 at 12:07 AM, Siegfried Heintze (Aditi)
<[EMAIL PROTECTED]> wrote:
> I started installing Mail::Sender, Mail::Send and Mail::Util and discovered
> it is prompting me for a default SMTP server as part of the installation
> server. Well I go to outlook and view my account settin
I started installing Mail::Sender, Mail::Send and Mail::Util and discovered it
is prompting me for a default SMTP server as part of the installation server.
Well I go to outlook and view my account settings and discover that I'm connect
to an exchange server. Is that what I specify for my SMTP s
On Thu, Feb 21, 2008 at 10:35 AM, Yoyoyo Yoyoyoyo <[EMAIL PROTECTED]> wrote:
> But the commands do still run in the command line, is there anyway to throw
> a perl variable in there?
Yes. You did it correctly. Look at the code I posted.
> my $y = `echo $x`;
--
To unsubscribe,
But the commands do still run in the command line, is there anyway to throw a
perl variable in there?
yitzle <[EMAIL PROTECTED]> wrote: Perl captures the output from backticks so
nothing gets printed to the screen.
__CODE__
my $x = "efg";
my $y = `echo $x`;
print $y;
__OUTP
Perl captures the output from backticks so nothing gets printed to the screen.
__CODE__
my $x = "efg";
my $y = `echo $x`;
print $y;
__OUTPUT__
efg
__END__
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi all,
I am having trouble representing a perl variable when using back ticks to run
commands from the unix command line. A simple example would be:
#!usr/bin/perl
$X = $ARGV[0];
`echo $X`;
This does not work (neither does `echo \$X`;). Is there anyway to represent a
perl variable when
On Feb 13, 2008 2:57 PM, ciwei <[EMAIL PROTECTED]> wrote:
snip
> so why the order of -n -e switch make the differience?
> this is perl 5.8.4.
> Thanks
snip
This is true in all versions of Perl. It is becuase you are allowed
to have more than one -e option:
perl -e 'print "read ";' -e 'print "th
On Feb 13, 2008 11:57 AM, ciwei <[EMAIL PROTECTED]> wrote:
> hostA>ls
> SUNWjassVRTSVRTSicsco VRTSvcs
> emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm
>
> hostA>ls | perl -en 'print if /SUNW/'
>
> return nothing , while
>
> hostA>ls | perl -ne 'print if /SUNW/'
hostA>ls
SUNWjassVRTSVRTSicsco VRTSvcs
emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm
hostA>ls | perl -en 'print if /SUNW/'
return nothing , while
hostA>ls | perl -ne 'print if /SUNW/'
SUNWits
SUNWjass
SUNWmlib
SUNWrtvc
so why the order of -n -e switch mak
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
Hi,
I'm trying to figure out how to install perl modules from command line (to
automate the install process). CPAN allowed me to d/l direct which results in
tarballs. Are there any caveats to watch out for when installing them this
way?
This will be done only on brand new Slackwa
On Sep 28, 12:32 pm, [EMAIL PROTECTED] (Bobby) wrote:
> On Friday 28 September 2007 12:26:08 Paul Lalli wrote:
> > > [EMAIL PROTECTED] (Bobby) wrote:
> > > > > What is the command to tell cpan to accept the default/suggested
> > > > > values?
> > When you run the cpan set up command, it will ask yo
> > > > Hi,
> > > >
> > > > What is the command to tell cpan to accept the default/suggested
> > > > values?
> >
> > No. Command line option so you don't have to be there and press Enter.
>
> When you run the cpan set up command,
On Sep 28, 9:26 am, [EMAIL PROTECTED] (Bobby) wrote:
> On Friday 28 September 2007 06:01:31 Srinivas wrote:
>
> > just hit "Enter"
>
> > -srini
>
> > Bobby wrote:
> > > Hi,
>
> > > What is the command to tell cpan to accept the defau
On Friday 28 September 2007 06:01:31 Srinivas wrote:
> just hit "Enter"
>
> -srini
>
> Bobby wrote:
> > Hi,
> >
> > What is the command to tell cpan to accept the default/suggested values?
No. Command line option so you don't have to be there and
just hit "Enter"
-srini
Bobby wrote:
Hi,
What is the command to tell cpan to accept the default/suggested values?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi,
What is the command to tell cpan to accept the default/suggested values?
--
Bobby
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
; 5 adding the bits from teat.pl
> 6 use warnings;
> 7 use LWP::Simple;
>
> Line 25 -- shown below, is just a simple getstore, this works when run from
> the command line, but when run form the webserver, I get above error
> message, I've tried the usual 500 error mes
On 9/27/07, Pat Rice <[EMAIL PROTECTED]> wrote:
> Line 25 -- shown below, is just a simple getstore, this works when run from
> the command line, but when run form the webserver, I get above error
> message, I've tried the usual 500 error messages, just wondering if anyone
&g
works when run from
the command line, but when run form the webserver, I get above error
message, I've tried the usual 500 error messages, just wondering if anyone
has any ideas ???
21 my $url = "http://private.private.com/pending/$variable_name";;
22 #print "\n This is t
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
Rob Dixon schreef:
> perl -e "print qq($_\n) foreach <*>"
which as good as identical to
perl -wle "print for <*>"
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
>
>
>- 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
he other is *.*. Funny though that
> sed *does* work.
Ah. Well there's your problem. The command line interpreter you're
running doesn't expand wildcards. That's why Perl wasn't giving you
any errors - it had nothing to do because there was no file named "*"
tha
Octavian Rasnita wrote:
Rob Dixon wrote:
John Degen wrote:
I'm using Perl 5.8.8 from ActiveState on Windows XP. I'm trying to
accomplish a search and replace in a number of files in the same
directory from the command line (cmd.exe). The problem is that the
command perl -i -e
A program in command line that works might be too long under Windows, but if
it is necessary it could be made sending the list of files to the program
with a pipe, like:
dir /b | perl -e "print ;"
This command prints the list of filenames on the console, and the dos
command d
--
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
John Degen wrote:
I'm using Perl 5.8.8 from ActiveState on Windows XP. I'm trying to
accomplish a search and replace in a number of files in the same
directory from the command line (cmd.exe). The problem is that the
command perl -i -e "s/old/new/" * fails silently, i.e. n
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
was perl -i -e
"s/ve/ver/" *.*
Any other ideas I might try?
Regards,
John
- Original Message
From: Bob McConnell <[EMAIL PROTECTED]>
To: John Degen <[EMAIL PROTECTED]>; beginners@perl.org
Sent: Monday, June 18, 2007 2:31:00 PM
Subject: RE: [Perl 5.8.8 on WinXP]
> From: John Degen [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 18, 2007 8:26 AM
> To: beginners@perl.org
> Subject: [Perl 5.8.8 on WinXP] Command line usage
>
> Hello,
>
> I'm using Perl 5.8.8 from ActiveState on Windows XP. I'm
> trying to accomplish a sea
Hello,
I'm using Perl 5.8.8 from ActiveState on Windows XP. I'm trying to accomplish a
search and replace in a number of files in the same directory from the command
line (cmd.exe). The problem is that the command perl -i -e "s/old/new/" * fails
silently, i.e. no ch
On May 4, 2007, at 2:44 PM, Nigel Peck wrote:
Within the script I want to know where it was executed from; CGI or
command line/cron job. I'm currently checking @ARGV to do this i.e.
if there is data in @ARGV then it was called from the command line,
but obviously this means there mu
Hi,
I have a script which is usually run through CGI, but I want to set it
up to be executed by a cron job each day too.
Within the script I want to know where it was executed from; CGI or
command line/cron job. I'm currently checking @ARGV to do this i.e. if
there is data in @ARGV th
>;
Sent: Wednesday, May 02, 2007 2:11 PM
Subject: RE: Win32 script cannot read command line argument.
-Original Message-
From: Vladimir Lemberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 02, 2007 14:01
To: beginners@perl.org
Subject: Win32 script cannot read command line argu
> -Original Message-
> From: Vladimir Lemberg [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 02, 2007 14:01
> To: beginners@perl.org
> Subject: Win32 script cannot read command line argument.
>
> Hi All,
>
> My script is unable to read argument when I'
Hi All,
My script is unable to read argument when I'm executing it as: script.pl
.
However, when I'm running it as: perl script.pl - it works fine.
I did associate perl scripts with Perl as explained in ActivePerl-Winfaq4.htm
All my scripts, which doesnt require any arguments works file.
I
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 befo
efore . . . so if I pass it
> > >
> > > -s "\.properties$"
> > >
> > > at the command line, it works as expetcted. Nice.
> >
> > That might be a shell thing?
> >
> > In Linux bash shell those quotes (I think) tell the shell to not
> &g
You can access the command line parameters directly without any module
with @ARGV.
Not sure if this helps.
myScript -f1 -f2
Something like this might work:
for ( $i = 0; $i < [EMAIL PROTECTED] - 1; $i += 2 ) {
hash{"AGV[$i]"} = AGV[$i + 1];
}
print "FIle 1: $hash{&
>
>Hi all,
>
>I was trying to write a script. I wanted to use multiple characters in
>command line switches.
>For example
>myScript -f1 -f2
>
>now getopt or getopts allows only for single character switches (please
>correct me if its not true).
>Is there any m
1 - 100 of 509 matches
Mail list logo