perl byte code generation

2008-03-30 Thread Anirban Adhikary
Dear list I want to compile a perl code into some encrypted format . My main goal is I don't want to give anyone my source code and I want only to give the executable. These codes will run only on Unix flavors O.S. So how to do this . I have tried with perlcc but not getting the output. One more th

RE: Load hash from a scalar

2008-03-30 Thread sanket vaidya
Here is the code to accomplish your task. use warnings; use strict; my $a = "a, 1, b, 2, c, 3"; $a =~ s/ //g; #delete spaces from $a my @array = split(",",$a); my %b = ( $array[0] => $array[1], $array[2] => $array[3], $array[4] => $array[5] ); for (keys%b) { print "$_ => $b{$_}\n"; } The

Re: need to find all the directories which have soft links in it

2008-03-30 Thread nag
can some one please help me with an example to list all the directories and their soft-links. Thanks, Nagesh 2008/3/26 Sandy <[EMAIL PROTECTED]>: > On 26 мар, 07:33, [EMAIL PROTECTED] (Nag) wrote: > > > > I have a parent directory which contains nearly 10 soft-links to other > > directories,

Re: sort without ignoring hyphens

2008-03-30 Thread John W. Krahn
[EMAIL PROTECTED] wrote: On Mar 29, 4:19 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: [EMAIL PROTECTED] wrote: When I do string comparisons in perl the strings seem to ignore the embedded hyphens. I want to sort strings assuming the 'dictionary' order of the chars is ASCII order: hypen, 0-9,

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Gunnar Hjalmarsson
Trudge wrote: On Mar 30, 8:13 am, [EMAIL PROTECTED] (Chas. Owens) wrote: If you have multiple templates you might want to use Inline::Files* instead of a straight DATA block. Chas. I've installed this and gave it a quick whirl. While it does print OK from various blocks, I couldn't get it to

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Gunnar Hjalmarsson wrote: Trudge wrote: Now I know it can be done, so I will be exploring this method. Not much to explore, really. Did you read the applicable Perl FAQ? Even if it provides this method, it doesn't exactly recommend it... Besides full-blown templat

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread aneely
Gunnar Hjalmarsson wrote: Trudge wrote: On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: Trudge wrote: I'm trying to get a script to interpolate variable values in a __DATA__ block if possible. It can be done; see the FAQ entry perldoc -q "expand variables"

Re: Inappropriate ioctl for device

2008-03-30 Thread John W. Krahn
[EMAIL PROTECTED] wrote: On Mar 30, 6:54 am, [EMAIL PROTECTED] (John W. Krahn) wrote: die() exits the program. Yes, I understand that die() exits the program. My question was are you able to process more than one line of code in a die() context? die(), like print() and warn(), prints a li

Re: sort without ignoring hyphens

2008-03-30 Thread tc314
On Mar 29, 4:19 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > [EMAIL PROTECTED] wrote: > > When I do string comparisons in perl the strings seem to ignore the > > embedded hyphens. > > I want to sort strings assuming the 'dictionary' order of the chars is > > ASCII order: hypen, 0-9, A-Z. > > It a

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Trudge
On Mar 30, 8:13 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Sat, Mar 29, 2008 at 9:14 PM, Trudge <[EMAIL PROTECTED]> wrote: > > > On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > > > Trudge wrote: > > > > I'm trying to get a script to interpolate variable values in a > > >

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Trudge
On Mar 30, 8:13 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Sat, Mar 29, 2008 at 9:14 PM, Trudge <[EMAIL PROTECTED]> wrote: > > > On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > > > Trudge wrote: > > > > I'm trying to get a script to interpolate variable values in a > > >

Re: Inappropriate ioctl for device

2008-03-30 Thread PekinSOFT
On Mar 30, 6:54 am, [EMAIL PROTECTED] (John W. Krahn) wrote: > That is usually written as: > > if ( @ARGV != 1 ) { > Good tip. Thank you. > Why not pass $EX_USAGE to ExitScript() instead of using global $ExitStatus? > > ExitScript( $EX_USAGE ); Consistency is all. I try to get into a ha

Re: commify_series script in cookbook page 94

2008-03-30 Thread Richard Lee
Dr.Ruud wrote: Richard Lee schreef: While reading perl cookbook, I came to page 94 and having a hard time understanding this particular phrase my $sepchar = grep( /,/ => @_ ) ? ";" : ","; Shortcutting alternative: my $sepchar = ","; for (@_) { /,/ and $sepchar = ";" and last

Re: commify_series script in cookbook page 94

2008-03-30 Thread Dr.Ruud
Richard Lee schreef: > While reading perl cookbook, I came to page 94 and having a hard time > understanding this particular phrase > > my $sepchar = grep( /,/ => @_ ) ? ";" : ","; Shortcutting alternative: my $sepchar = ","; for (@_) { /,/ and $sepchar = ";" and last } but (unless @_ i

Re: commify_series script in cookbook page 94

2008-03-30 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: While reading perl cookbook, I came to page 94 and having a hard time understanding this particular phrase my $sepchar = grep( /,/ => @_ ) ? ";" : ","; I recognize the ternary operator and grep but I am not sure how they are forming the meaning together

Re: commify_series script in cookbook page 94

2008-03-30 Thread John W. Krahn
yitzle wrote: my $sepchar = grep( /,/ => @_ ) ? ";" : ","; And I also don't understand what ";" is doing in the ternary operator?? The ";" is what is returned if the condition is TRUE. "( / ,/ => @_)" is a(n anonymous) hash. No it is not. /,/ and @_ are just two arguments to the grep() fu

Re: commify_series script in cookbook page 94

2008-03-30 Thread Rob Dixon
Richard Lee wrote: > > While reading perl cookbook, I came to page 94 and having a hard time > understanding this particular phrase > > my $sepchar = grep( /,/ => @_ ) ? ";" : ","; > > I recognize the ternary operator and grep but I am not sure how they are > forming the meaning together. > >

Re: commify_series script in cookbook page 94

2008-03-30 Thread yitzle
> my $sepchar = grep( /,/ => @_ ) ? ";" : ","; > And I also don't understand what ";" is doing in the ternary operator?? The ";" is what is returned if the condition is TRUE. "( / ,/ => @_)" is a(n anonymous) hash. I've had no idea that grep can operate on a hash. However, it seems that "grep( /

Re: commify_series script in cookbook page 94

2008-03-30 Thread John W. Krahn
Richard Lee wrote: While reading perl cookbook, I came to page 94 and having a hard time understanding this particular phrase my $sepchar = grep( /,/ => @_ ) ? ";" : ","; I recognize the ternary operator and grep but I am not sure how they are forming the meaning together. I thought grep

commify_series script in cookbook page 94

2008-03-30 Thread Richard Lee
While reading perl cookbook, I came to page 94 and having a hard time understanding this particular phrase my $sepchar = grep( /,/ => @_ ) ? ";" : ","; I recognize the ternary operator and grep but I am not sure how they are forming the meaning together. I thought grep needed lists to wo

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Chas. Owens
On Sat, Mar 29, 2008 at 9:14 PM, Trudge <[EMAIL PROTECTED]> wrote: > > On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > > Trudge wrote: > > > I'm trying to get a script to interpolate variable values in a > > > __DATA__ block if possible. This is a kind of alternative to a ful

Re: Inappropriate ioctl for device

2008-03-30 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hey All! Hello, I've written a Bash script called `clock`, which is called by one of two symbolic links: `clock-in` and `clock-out`. This script is, effectively, a time-clock for tracking time spent on various projects for clients. This script generates a "time card

Re: Automate a search query from a website

2008-03-30 Thread Gunnar Hjalmarsson
JBallinger wrote: I am trying to automate a search query from a website that uses CGI script to process the query. I want my script to post a search query to a website, and then parse the html result from the website back into an output file. Could someone give me some direction on how to do th

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Gunnar Hjalmarsson
Trudge wrote: On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: Trudge wrote: I'm trying to get a script to interpolate variable values in a __DATA__ block if possible. It can be done; see the FAQ entry perldoc -q "expand variables" while () {

Re: Interpolate variable in a __DATA__ block

2008-03-30 Thread Trudge
On Mar 29, 4:05 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > Trudge wrote: > > I'm trying to get a script to interpolate variable values in a > > __DATA__ block if possible. This is a kind of alternative to a full- > > blown template method. I'm not sure if I can even do what I want, > > hen

Inappropriate ioctl for device

2008-03-30 Thread PekinSOFT
Hey All! I've written a Bash script called `clock`, which is called by one of two symbolic links: `clock-in` and `clock-out`. This script is, effectively, a time-clock for tracking time spent on various projects for clients. This script generates a "time card" file, if one does not exist in my "

Automate a search query from a website

2008-03-30 Thread JBallinger
Hi, I am trying to automate a search query from a website that uses CGI script to process the query. I want my script to post a search query to a website, and then parse the html result from the website back into an output file. Could someone give me some direction on how to do this? Where shoul

opening sftp command as a file

2008-03-30 Thread kilaru rajeev
Hi, I am trying to run the following sub routine to copy a file from remote dir to local. I am passing three arguments remote file, local file and the host along with the user name. But, the program is not working. could somebody please help me. sub getFile { my ( $rFile, $lFile, $rHost ) = @_;

pdf protection for generated pdfs

2008-03-30 Thread Saurabh Singhvi
Hi All, Greetings. I am trying to create pdfs with perl (basically some text data) and I want to give them pdf protection to disallow any modification. The target is not to really achieve industry grade protection but to just let the end user know that it is not recommended to modify the content i