Re: Perl script: where was I executed from?

2020-11-22 Thread Vlado Keselj
Hi, I am not sure that I completely understand your question (for example, what does it mean to run a script "dynamically or not"). You could retrieve the list of processes from OS to try to figure out how was the script ran, but it is a bit messy. Just maybe: maybe you want to see w

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
On 11/22/20 12:33 AM, wagsworl...@yahoo.com wrote: The only problem I was trying to determine was could i know if I was running from BBEdit dynamically or not? That was the question. No problem, just could I know what environment I was running in. The output was a the Unix output log which up

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
The only problem I was trying to determine was could i know if I was running from BBEdit dynamically or not? That was the question. No problem, just could I know what environment I was running in. The output was a the Unix output log which up to the last update automatically came to the front

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
on a unix system. and why/how would a log file come to the front? it would have to be open in some program. A gentleman on the BBEdit mail list gave an   osasctipt that one can execute from within the script bring executed. But sometimes I run from terminal session, so don’t want to tell BBEd

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
I run from terminal session, so don’t want to tell BBEdit to do something is not required. Hence where am I and from that know what to do... Thoughts??? ;) WagsWorld World of Perl Hebrews 4:15 Ph D:(408)914-1341 Ph M:(408)761-7391 On Nov 21, 2020, 18:09 -0800, Uri Guttman , wrote: > On 11/21

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
On 11/21/20 7:42 PM, wagsworld48 via beginners wrote: It was a good idea, but that gives me zsh which is what in this case BBEdit uses to execute the script. So with your code of $ENV, then I looked at the variables within ENV and picked one that was there for BBEdit and not there in a normal

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
It was a good idea, but that gives me zsh which is what in this case BBEdit uses to execute the script. So with your code of $ENV, then I looked at the variables within ENV and picked one that was there for BBEdit and not there in a normal terminal run. Know other ways, but this at least is one

Re: Perl script: where was I executed from?

2020-11-21 Thread sisyphus
Perhaps: perl -le 'print $ENV{SHELL}' Cheers, Rob On Sun, Nov 22, 2020 at 8:00 AM wagsworld48 via beginners < beginners@perl.org> wrote: > Mind is blank, but want to know if started with say BBEdit or bash or ? > > Probably very simple, but at this point, no idea... ;) > > WagsWorld > World of P

Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
Mind is blank, but want to know if started with say BBEdit or bash or ? Probably very simple, but at this point, no idea... ;) WagsWorld World of Perl Hebrews 4:15 Ph D:(408)914-1341 Ph M:(408)761-7391

Re: can I use some kind of binary string?

2019-05-18 Thread Shlomi Fish
Hi, On Sat, 18 May 2019 14:02:46 +0200 hwilmer wrote: > On 5/16/19 9:56 PM, Shlomi Fish wrote: > > On Thu, 16 May 2019 13:13:16 +0200 > > hwilmer wrote: > > > >> On 5/11/19 11:07 AM, Shlomi Fish wrote: > [...] > >>>> So I would wa

Re: can I use some kind of binary string?

2019-05-18 Thread hwilmer
On 5/16/19 9:56 PM, Shlomi Fish wrote: On Thu, 16 May 2019 13:13:16 +0200 hwilmer wrote: On 5/11/19 11:07 AM, Shlomi Fish wrote: [...] So I would want to use something like my $binary_data = `curl -k "https://www.example.com/some.jpg"`; Perl distinguishes between 8-bit/bina

Re: can I use some kind of binary string?

2019-05-16 Thread Shlomi Fish
On Thu, 16 May 2019 13:13:16 +0200 hwilmer wrote: > On 5/11/19 11:07 AM, Shlomi Fish wrote: > > Hi hwilmer, > > > > On Fri, 10 May 2019 19:09:50 +0200 > > hwilmer wrote: > > > >> Hi, > >> > >> I would like to use curl to retriev

Re: can I use some kind of binary string?

2019-05-16 Thread hwilmer
On 5/11/19 11:07 AM, Shlomi Fish wrote: Hi hwilmer, On Fri, 10 May 2019 19:09:50 +0200 hwilmer wrote: Hi, I would like to use curl to retrieve an image from a web server which I want to store in a table in a mariadb database without downloading the image to a file. For this application, I

Re: can I use some kind of binary string?

2019-05-11 Thread Shlomi Fish
Hi hwilmer, On Fri, 10 May 2019 19:09:50 +0200 hwilmer wrote: > Hi, > > I would like to use curl to retrieve an image from a web server which I > want to store in a table in a mariadb database without downloading the > image to a file. For this application, I do no

can I use some kind of binary string?

2019-05-10 Thread hwilmer
Hi, I would like to use curl to retrieve an image from a web server which I want to store in a table in a mariadb database without downloading the image to a file. For this application, I do not want to store references to files stored in some file system instead. So I would want to use

Re: Device::SerialPort Am I Missing Something?

2017-11-04 Thread Martin McCormick
at a higher scope, will still be empty. > > I imagine things might change if you remove the "my" from that > assignment, so that you're assigning the result to the $c that the loop > condition is looking at. Of course! I didn't even give that a second thought.

Re: Device::SerialPort Am I Missing Something?

2017-11-04 Thread David Precious
necessarily end with a newline or carriage return. > > I have never yet gotten anything like the following to > work: > > #!/usr/bin/perl -w > use strict; > #use warnings::unused; > use File::Basename; > use File::Copy; > use File::Spec; > use Time::Local; > use

Device::SerialPort Am I Missing Something?

2017-11-03 Thread Martin McCormick
The perldoc for Device::SerialPort states that the unix version is based on the Windows serial port module and a few details are different or not supported but the important parts are said to work. Strangely enough, the only thing I have gotten to work as described is the $port->in

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-08-03 Thread Chas. Owens
def, 0, 0.0, "", "0", and the empty list. Negation turns any value that is true into a false value (PL_sv_no) and any value that is false into a true value (PL_sv_yes). > Either are neither false, nor true. > You are coming to Perl 5 with assumptions that do not hold

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-08-03 Thread Paul Johnson
On Thu, Aug 03, 2017 at 09:27:42PM +0200, hw wrote: > > It is nonsense to logically negate a string, and it is nonsense to convert > undefined values into 'false'. Either are neither false, nor true. > > For undefined values, there is no way of deciding whether they are true or > false > becaus

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-08-03 Thread hw
David Mertens wrote: On Thu, Jul 6, 2017 at 11:05 PM, mailto:sisyph...@optusnet.com.au>> wrote: Perl is highly unusual in that the operator, not the operand, dictates the context. Good point - and one that I hadn't got around to noticing. Therefore, the '!&

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-07 Thread David Mertens
On Thu, Jul 6, 2017 at 11:05 PM, wrote: > Perl is highly unusual in that the operator, not the operand, dictates the >> context. >> > > Good point - and one that I hadn't got around to noticing. > > Therefore, the '!' operator has to be set up to eith

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-07 Thread Илья Рассадин
t: Friday, July 07, 2017 12:07 PM To: Sisyphus Cc: Chas. Owens ; hw ; Perl Beginners Subject: Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' On Thu, Jul 6, 2017 at 9:12 PM, wrote: I find it a little surprising that use of the '!&#x

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread sisyphus1
From: David Mertens Sent: Friday, July 07, 2017 12:07 PM To: Sisyphus Cc: Chas. Owens ; hw ; Perl Beginners Subject: Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' On Thu, Jul 6, 2017 at 9:12 PM, wrote: I find it a little surprising that use of

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread David Mertens
On Thu, Jul 6, 2017 at 9:12 PM, wrote: > I find it a little surprising that use of the '!' operator is all that's > needed to add the stringification stuff: > > ... > > If the '!' operator didn't do that, then I believe the OP would be seeing &g

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread sisyphus1
From: Chas. Owens Sent: Friday, July 07, 2017 12:34 AM To: hw ; beginners@perl.org Subject: Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' On Thu, Jul 6, 2017 at 9:38 AM hw wrote: Chas. Owens wrote: $i started off as an IV, but gets promoted to

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread Chas. Owens
;. All other values are true. These give you different results, and that is just wrong. I did > assign a /number/ to $i and never a string. No, you assigned the result of the negation operator which returns PL_sv_yes if the operand is false (see above for the list of false values) or PL_sv_no

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread Chas. Owens
On Thu, Jul 6, 2017 at 9:38 AM hw wrote: > Chas. Owens wrote: > > > > > > On Sat, Jul 1, 2017, 12:44 Shlomi Fish shlo...@shlomifish.org>> wrote: > > > > Hi Shawn! > > > > On Sat, 1 Jul 2017 11:32:30 -0400 > > Shawn H Corey m

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread hw
X Dungeness wrote: It's about what unary ! (bang operator) does to the operand Here's the dissonance: perl -E '$x=0; say "x=$x"; $x = !!$x; say "x=$x"' x=0 x= It behaves as you expect until you "bang" it twice. I found a good explanation

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread hw
Chas. Owens wrote: On Sat, Jul 1, 2017, 12:44 Shlomi Fish mailto:shlo...@shlomifish.org>> wrote: Hi Shawn! On Sat, 1 Jul 2017 11:32:30 -0400 Shawn H Corey mailto:shawnhco...@gmail.com>> wrote: > !!$i which is !(!(0)) which is !(1) which is 0 > I

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread hw
wrote: Hi, can someone please explain this: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' i: Particularly: + Why doesn´t it print 1? Because !!$i is zero + How is this not a bug? Nope, no bug. + What is being printed here? !!$i which

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread X Dungeness
It's about what unary ! (bang operator) does to the operand Here's the dissonance: perl -E '$x=0; say "x=$x"; $x = !!$x; say "x=$x"' x=0 x= It behaves as you expect until you "bang" it twice. I found a good explanation in the Camel: "Unar

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread John Harris
What are these emails really about? On Jul 1, 2017 2:42 PM, "Chas. Owens" wrote: > > > On Sat, Jul 1, 2017, 12:44 Shlomi Fish wrote: > >> Hi Shawn! >> >> On Sat, 1 Jul 2017 11:32:30 -0400 >> Shawn H Corey wrote: >> >> > !!$i whic

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread Chas. Owens
On Sat, Jul 1, 2017, 12:44 Shlomi Fish wrote: > Hi Shawn! > > On Sat, 1 Jul 2017 11:32:30 -0400 > Shawn H Corey wrote: > > > !!$i which is !(!(0)) which is !(1) which is 0 > > > > I suspect !1 returns an empty string in scalar context. > !1 returns PL_sv_no

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread Shlomi Fish
>> On Sat, 1 Jul 2017 17:27:02 +0200 > >> hw wrote: > >> > >>> > >>> Hi, > >>> > >>> can someone please explain this: > >>> > >>> > >>> perl -e 'my $i = 0; $i = defined($i)

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread Shlomi Fish
Hi Shawn! On Sat, 1 Jul 2017 11:32:30 -0400 Shawn H Corey wrote: > On Sat, 1 Jul 2017 17:27:02 +0200 > hw wrote: > > > > > Hi, > > > > can someone please explain this: > > > > > > perl -e 'my $i = 0; $i = defined($i) ? (!!$i)

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread Shawn H Corey
On Sat, 1 Jul 2017 17:27:02 +0200 hw wrote: > > Hi, > > can someone please explain this: > > > perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' > i: > > > Particularly: > > > + Why doesn´t it print 1? Bec

perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread hw
Hi, can someone please explain this: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";' i: Particularly: + Why doesn´t it print 1? + How is this not a bug? + What is being printed here? + How do you do what I intended in perl? -- To unsubscrib

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-02-25 Thread khalil zakaria Zemmoura
Naming multiple variables with the same name like you did ($args, %args) is a bad idea. because when you want to access the value of the hash %args ($args{FN}) you are accessing in reality what was shifted in the scalar $args and not the hash %args because perl use simbolic reference. here is a li

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-02-25 Thread ZEMMOURA Khalil Zakaria
On Sun, Jan 15, 2017 at 12:45:41PM -0800, al...@myfastmail.com wrote: > Hi > > On Sun, Jan 15, 2017, at 12:23 PM, Илья Рассадин wrote: > > I think, you can use this aproach > > If I use either of those > > > sub modrec { > -

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Chas. Owens
Hm, ok. As long as it's not wrong/broken in some weird way. I kept getting scolded to "check your code with perlcritic" as if that's the *right* way to do it. So when I kept getting that perlcritic-ism, I started looking around for why. LOTS of post telling you different things

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Rob Dixon
Hi Alan You are unpacking `@_` in a way, but perlcritic doesn't recognise doing it this way. I think you'd be better off without dereferencing the hash, and using a slice to assign your local variables. I would write your subroutine like this sub modrec {

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
Hi, On Sun, Jan 15, 2017, at 01:01 PM, Shawn H Corey wrote: > > Is there a different, recommended way? > > Nothing's wrong. perlcritic does not this valid method, that's all. > > TIMTOWTDI (There Is More Than One Way To Do It.) Hm, ok. As long as it's not w

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Shawn H Corey
On Sun, 15 Jan 2017 12:09:53 -0800 al...@myfastmail.com wrote: > What's wrong with the way I'm unpacking the arguments passed to the > subroutine, > > my %args = %{ shift @_ }; > > Is there a different, recommended way? Nothing's wrong. perlcritic does not this valid method, that's all.

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Илья Рассадин
Hi! You forgot arrow operator $args->{'FN'}, not $args{'FN'} 15.01.17 23:45, al...@myfastmail.com пишет: Hi On Sun, Jan 15, 2017, at 12:23 PM, Илья Рассадин wrote: I think, you can use this aproach If I use either of those sub modrec { -

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
Hi On Sun, Jan 15, 2017, at 12:23 PM, Илья Рассадин wrote: > I think, you can use this aproach If I use either of those sub modrec { - my %args = %{ shift @_ }; + my ($args) = @_; 30 my $fn = $args

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Илья Рассадин
Hi! I think, you can use this aproach sub modrec { my ($args) = @_; # or my $args = shift @_; use what you like more my $fn = $args->{'FN'}; } 15.01.17 23:09, al...@myfastmail.com пишет: Hi, I have a simple script with a subroutine that I pass scalar &

script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
Hi, I have a simple script with a subroutine that I pass scalar & array arguments to, #!/usr/bin/perl use 5.01201; use strict; use warnings; my $this_fn = "input.txt"; my @this_dr = qw( /path/1 /path/2

What is the Perl equivalent of "net user username \domain" if I am on Linux or Mac?

2016-03-07 Thread Kenneth Wolcott
Hi; What is the Perl equivalent of "net user username \domain" if I am on Linux or Mac? None of our Linux or Mac machines are a member of the specific domain in question. Do have to obtain the name of the AD/LDAP server and obtain some kind of credentials for me to inqui

my makefile. Doesn’t work the way I intend it to

2015-11-19 Thread Uday Vernekar
Hello Group, I have the following in my makefile. Doesn’t work the way I intend it to. How do I do conditional test with a regular expression ? ifeq (${HOST_TYPE},x86_64)-- à works ifeq (${LATTICE_VERSION},d3

Re: How do I fork a process and return results to the user?

2015-08-30 Thread Shlomi Fish
Hi G, please reply to all recipients. On Sun, 30 Aug 2015 21:47:47 + G M wrote: > Hi, > Can anyone help me with this? > I have two scripts, the first one calls the exec command which then invokes > the second script. The second script then creates a fork process. The child

How do I fork a process and return results to the user?

2015-08-30 Thread G M
Hi, Can anyone help me with this? I have two scripts, the first one calls the exec command which then invokes the second script. The second script then creates a fork process. The child process in the fork does a webservice query which may take a few minutes to return results. What I want to

Re: Can I join this mailing list please?

2015-05-14 Thread malisetti rammurthy
HI Zackary, Yes you can. Use the "How do I subscribe?" section in the below link. http://learn.perl.org/faq/beginners.html#subscribe Thank You, Ram Murthy On Thu, May 14, 2015 at 5:21 PM, Zackary M wrote: > Thanks! > > Zac >

Re: Can I join this mailing list please?

2015-05-14 Thread Shlomi Fish
Hi Zac, On Thu, 14 May 2015 07:51:50 -0400 Zackary M wrote: > Thanks! > > Zac I don't see why you cannot. See http://learn.perl.org/faq/beginners.html#subscribe for subscription instructions. Regards,

Can I join this mailing list please?

2015-05-14 Thread Zackary M
Thanks! Zac

Re: Eclipse - How do I get back to the first splash screen

2015-03-13 Thread Jim Gibson
> On Mar 13, 2015, at 2:07 PM, Sherman Willden > wrote: > > I downloaded Eclipse and I was looking at the screens and in general just > messing with Eclipse. Now I can't find the first splash screen with the > tutorials, samples, and such. Also is there a help button o

Eclipse - How do I get back to the first splash screen

2015-03-13 Thread Sherman Willden
I downloaded Eclipse and I was looking at the screens and in general just messing with Eclipse. Now I can't find the first splash screen with the tutorials, samples, and such. Also is there a help button on Eclipse? Thank you; Sherman

Re: An issue of Scope that I do not understand

2015-02-28 Thread Martin G. McCormick
ort_statics->(); > else > $report_dynamic->(); > ... > } > > But with everything in lexical scope, you could just pass any needed > arg's directly and > eliminate the closure altogether. Many thanks. I actually did simply pass $task to each of those s

Re: An issue of Scope that I do not understand

2015-02-28 Thread Charles DeRykus
> ... > > I'm not sure why you don't just pass $task as an argument to the > report_xxx subs...? > > A closure (perldoc -q closure) would be the long way around unless > I've missed something: > > my $task; > my $iter; > my $report_static = sub { my $ref = shift; >

Re: An issue of Scope that I do not understand

2015-02-28 Thread Shlomi Fish
Hi Martin, thanks for your kind words. On Sat, 28 Feb 2015 09:01:26 -0600 "Martin G. McCormick" wrote: > Shlomi Fish writes: > http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top > > > > (Note: perl-begin.org is a domain I originated and main

Re: An issue of Scope that I do not understand

2015-02-28 Thread Martin G. McCormick
Shlomi Fish writes: http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top > > (Note: perl-begin.org is a domain I originated and maintain). Shlomi Fish, Uri and Brock, I certainly wish I had known about a resource like this earlier in my relatively short perl

Re: An issue of Scope that I do not understand

2015-02-28 Thread Shlomi Fish
"use strict;" is goot, but the "-w" flag should be replaced by "use warnings;": http://perl-begin.org/tutorials/bad-elements/#the-dash-w-flag (Note: perl-begin.org is a domain I originated and maintain). > > #Declare main variables. > > #main locals >

Re: An issue of Scope that I do not understand

2015-02-27 Thread Charles DeRykus
On Fri, Feb 27, 2015 at 8:24 PM, Martin G. McCormick wrote: > Brock Wilcox writes: >> I'm afraid a bit more context is needed to identify the problem. Could you >> post your entire bit of code into a gist or pastebin or something for us >> to >> see? > > I'll do better than that. This is a

Re: An issue of Scope that I do not understand

2015-02-27 Thread Uri Guttman
y in a "foreach" loop. what are you trying to do here? closures are very useful but rarely do beginners need them and there is no need in that example and likely in your real problem as well. i smell an XY problem and you are likely to just need better data structures or passing data by r

Re: An issue of Scope that I do not understand

2015-02-27 Thread Martin G. McCormick
Brock Wilcox writes: > I'm afraid a bit more context is needed to identify the problem. Could you > post your entire bit of code into a gist or pastebin or something for us > to > see? I'll do better than that. This is a script which is stripped of everything but the problem code. It is 2

Re: An issue of Scope that I do not understand

2015-02-27 Thread Brock Wilcox
I'm afraid a bit more context is needed to identify the problem. Could you post your entire bit of code into a gist or pastebin or something for us to see? On Feb 27, 2015 9:52 PM, "Martin G. McCormick" < mar...@server1.shellworld.net> wrote: > I put together an an

An issue of Scope that I do not understand

2015-02-27 Thread Martin G. McCormick
I put together an anonymous subroutine which partly works. There is an array called @tasks which is defined as a local variable in the main routine and when I call the anonymous subroutine, one can still read all the elements in @tasks. There is also a single scaler called $task

Re: Should I add ExtUtils::MakeMaker as prerequisite to Makefile?

2015-02-27 Thread David Precious
On Fri, 27 Feb 2015 23:41:22 +0100 Alex Becker wrote: > So my idea was to specify EUMM v6.46 as minimum in PREREQ_PM. This > way, I would not have to do all this 'if the EUMM version is greater > than X then add Y to Makefile.PL' stuff. > > So, would it work? Does it make

Should I add ExtUtils::MakeMaker as prerequisite to Makefile?

2015-02-27 Thread Alex Becker
Hi! When writing a Makefile.PL for a module (no, I don't want to read about other ways to do it now), does it make sense to add ExtUtils::MakeMaker (EUMM) to the PREREQ_PM module prerequisites list? I'm asking because I saw some Makefile.PL where the installed version of EUMM was c

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Shlomi Fish
intention for the user to provide a single file or a > directory, but it doesn't seem to be working properly. > > I've tried running it like so: > > $ ./eztar -c git.tar.gz * > > And only one file in the working directory seems to be getting added to > the tar

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Mike Dunaway
g properly. I've tried running it like so: $ ./eztar -c git.tar.gz * And only one file in the working directory seems to be getting added to the tarball so I think I may be doing something incorrect. Likewise with listing contents of a tarball, only the top most files inside the tar

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Mike Dunaway
nt instead. Here is the code snippet sub help { print << "MENU"; Easily create and extract tarballs -h display this menu -c compress file/directory"; | eztar -c to compress> -e extract tarball | eztar -e ; -l list contents of tarball"; | eztar -l "; M

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Shlomi Fish
o files specified.'; $files is in plural, but it is a scalar and a single string. What is your intention? Also see: http://perl-begin.org/tutorials/bad-elements/#calling-variables-file > my $tar = Archive::Tar->new(); > $tar->write($file_name); > $tar->r

Re: Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Shaji Kalidasan
lls -h display this menu -c compress file/directory"; | eztar -c -e extract tarball | eztar -e ; -l list contents of tarball"; | eztar -l "; MENU } I am not going much into the technical aspects. Hope someone will throw more light into the technical details and the best

Just gotten back into Perl, wondering how I could better write my first app.

2014-05-10 Thread Mike Dunaway
So I've just gotten back into Perl and I've written a tarring utility for my first application. It seems to work okay, but I'm wondering how it could better be written. Any ideas? #!/usr/bin/perl -w use strict; use Archive::Tar; use Getopt::Std; use feature qw(say); my %opt;

Re: How do I pass arrays into a subroutine

2013-09-07 Thread Karol Bujaček
Hello, On 09/07/2013 02:15 PM, Dr.Ruud wrote: On 07/09/2013 13:43, Karol Bujaček wrote: print Dumper(@_);# just look how the @_ looks like Consider: print Dumper( \@_ ); I chose Data::Dumper::Simple <http://search.cpan.org/~ovid/Data-Dumper-Simple-0.11/lib/Data/Dum

Re: How do I pass arrays into a subroutine

2013-09-07 Thread Shawn H Corey
On Sat, 07 Sep 2013 14:15:39 +0200 "Dr.Ruud" wrote: > On 07/09/2013 13:43, Karol Bujaček wrote: > > >print Dumper(@_);# just look how the @_ looks like > > Consider: print Dumper( \@_ ); > > > >my($animals, $digits) = @_; > > > >my @animals = @$animals; # dereference > >

Re: How do I pass arrays into a subroutine

2013-09-07 Thread Dr.Ruud
On 07/09/2013 13:43, Karol Bujaček wrote: print Dumper(@_);# just look how the @_ looks like Consider: print Dumper( \@_ ); my($animals, $digits) = @_; my @animals = @$animals; # dereference my @digits = @$digits; # dereference The comment is inaccurate. Why would

Re: How do I pass arrays into a subroutine

2013-09-07 Thread Karol Bujaček
On 09/07/2013 01:11 PM, eventual wrote: Hi, In the example below, how do I pass @pets and @numbers into the subroutine so that @animals = @pets and @digits = @numbers. Thanks my @pets = ('dogs' , 'cats' , 'horses'); my @numbers = (1..10); &study (@pets

Re: How do I pass arrays into a subroutine

2013-09-07 Thread *Shaji Kalidasan*
- Your talent is God's gift to you. What you do with it is your gift back to God. --- From: eventual To: "beginners@perl.org&qu

Re: How do I pass arrays into a subroutine

2013-09-07 Thread Shlomi Fish
Hi Eventual, On Sat, 7 Sep 2013 04:11:06 -0700 (PDT) eventual wrote: > Hi, >   > In the example below, how do I pass @pets and @numbers into the subroutine so > that @animals = @pets  and > @digits = @numbers. Please look into references and pass the arrays as references. Se

How do I pass arrays into a subroutine

2013-09-07 Thread eventual
Hi,   In the example below, how do I pass @pets and @numbers into the subroutine so that @animals = @pets  and @digits = @numbers. Thanks   my @pets = ('dogs' , 'cats' , 'horses'); my @numbers = (1..10);   &study (@pets , @numbers);   sub study {   my (

Re: Creating a Perl web site, how should I build this

2013-07-04 Thread David Christensen
On 07/03/13 10:13, Robert Freiberger wrote: I'm working on a work project where we are moving a few Perl scripts from a command line to a web page that will allow more users to access the tool. Basically it's a very simple script that takes an updated CSV feed, runs a internal test, then reports

Re: Creating a Perl web site, how should I build this

2013-07-03 Thread Brandon McCaig
everyone shell access. But the > question is how should we build out this web page? In college I > did some CGI Perl writing but it looks like (I could be wrong) > that this is no longer the standard, and more people recommend > going with Dancer, Mojolicious or Catalyst. > > If

Re: Creating a Perl web site, how should I build this

2013-07-03 Thread jbiskofski
#x27;t > want to give everyone shell access. But the question is how should we build > out this web page? In college I did some CGI Perl writing but it looks like > (I could be wrong) that this is no longer the standard, and more people > recommend going with Dancer, Mojolicious or Catal

Re: Creating a Perl web site, how should I build this

2013-07-03 Thread Lawrence Statton
is web page? In college I did some CGI Perl writing but it looks like (I could be wrong) that this is no longer the standard, and more people recommend going with Dancer, Mojolicious or Catalyst. If you are building a web *site* - with hundreds of pages linked to each other with a common theme and

Creating a Perl web site, how should I build this

2013-07-03 Thread Robert Freiberger
s from the test. Ideally, we would like to have this run from a web page instead of from the command line as more people would like to access the tool but don't want to give everyone shell access. But the question is how should we build out this web page? In college I did some CGI Perl writing bu

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-07 Thread Gerhard Jungwirth
gt; depleted and output can resume. Otherwise, some output would be lost. > > I was curious about this so i tried it out. It turns out that when I do ./script.pl | cat cat seems to add a big output buffer between your script and your console. So when i hit Ctrl-s the script will co

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread shawn wilson
I seriously think you've found a feature and you don't know what it is and just want to use it because it's there. Please read this: http://en.wikipedia.org/wiki/Software_flow_control After you're done, I recommend this in your shell rc: stty -ixon On Thu, Jun 6, 2013

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Robert Wohlfarth
On Thu, Jun 6, 2013 at 11:29 AM, Nemana, Satya wrote: > Thanks Travis, Shlomi , Shawn, Luca, and James. > > The program pauses i.e does not run further when I press Cntrl –S > > When I press Ctrl-Q again, the program resumes excactly where it was when > I hit cntrl-q.

RE: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Nemana, Satya
Thanks Travis, Shlomi , Shawn, Luca, and James. The program pauses i.e does not run further when I press Cntrl –S When I press Ctrl-Q again, the program resumes excactly where it was when I hit cntrl-q. It is not a deamon, but a simple automation program and it is single threaded , goes on

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Jim Gibson
On Jun 6, 2013, at 9:04 AM, Travis Thornhill wrote: > > > On Jun 5, 2013, at 4:18, "Nemana, Satya" wrote: > >> Hi >> >> I am having a slight difficulty in getting this accomplished. >> When my perl program keeps running, I sometimes need to pau

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Travis Thornhill
On Jun 5, 2013, at 4:18, "Nemana, Satya" wrote: > Hi > > I am having a slight difficulty in getting this accomplished. > When my perl program keeps running, I sometimes need to pause the screen > output and check some things on the output. > But, I want my p

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread shawn wilson
If it's a daemon, use something like start-stop-daemon or use something like Net::Daemon (search cpan). I prefer the former as I find it easier to debug but do have my programs create a pidfile vs having start-stop-daemon do it. If you just want it put in the background sometimes but gene

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Luca Ferrari
On Wed, Jun 5, 2013 at 1:18 PM, Nemana, Satya wrote: > Hi > > > > I am having a slight difficulty in getting this accomplished. > > When my perl program keeps running, I sometimes need to pause the screen > output and check some things on the output. > > But, I

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-05 Thread Shlomi Fish
Hi Satya, On Wed, 5 Jun 2013 11:18:14 + "Nemana, Satya" wrote: > Hi > > I am having a slight difficulty in getting this accomplished. > When my perl program keeps running, I sometimes need to pause the screen > output and check some things on the output. But, I

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-05 Thread James Alton
a, Satya wrote: > Hi**** > > ** ** > > I am having a slight difficulty in getting this accomplished. > > When my perl program keeps running, I sometimes need to pause the screen > output and check some things on the output. > > But, I want my program to still kee

Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-05 Thread James Alton
Beginner to beginner here, but if you wanted to do two things at once, wouldn't you just need to use threads? http://perldoc.perl.org/threads.html (Disclaimer: Threads might be overkill, but it was the first thing I thought of.) James On Wed, Jun 5, 2013 at 5:18 AM, Nemana, Satya wrote:

how to make perl program run continue when i press control+s to pause screen output

2013-06-05 Thread Nemana, Satya
Hi I am having a slight difficulty in getting this accomplished. When my perl program keeps running, I sometimes need to pause the screen output and check some things on the output. But, I want my program to still keep running while I pause the screen. (using ctrl+s on putty) But the program

Re: Scripts in Padre do not run. Need step-by-step help in setting up, asall current procedures I have found have failed for me.

2013-05-28 Thread Ruud H.G. van Tol
On 26/05/2013 14:28, Michael Rasmussen wrote: On Sat, May 25, 2013 at 04:19:27PM +0200, Dr.Ruud wrote: On 24/05/2013 22:25, Michael Goldsbie wrote: [...] I installed DWIM Perl [...] So after downloading and installing it, what's the next step? On http://dwimperl.com/ there is a li

  1   2   3   4   5   6   7   8   9   10   >