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 inq

Re: Select equivalent in perl

2011-04-09 Thread Tim Maher
that. Quick question: I have been using Select function in shell to present menu to users. Do we have a select equivalent in perl? Yes we do! I uploaded a version to CPAN many years ago, which I (for one) use all the time. Nowadays the CPAN installation doesn't work on some systems, so I

Select equivalent in perl

2011-04-07 Thread Balaji krishnan
Hi folks I have been using shell script for my admin work and recently decided to use perl fo all my automation. So proud I did that. Quick question: I have been using Select function in shell to present menu to users. Do we have a select equivalent in perl? Or if I have a list of names

Re: Select equivalent in perl

2011-04-07 Thread Jim Gibson
to present menu to users. Do we have a select equivalent in perl? Or if I have a list of names in an array what is the best way to present them in a menu and prompt the user to select one from the list? I use the print statement to present the list of items with a number, then print a prompt

Re: Select equivalent in perl

2011-04-07 Thread Alan Haggai Alavi
a select equivalent in perl? Or if I have a list of names in an array what is the best way to present them in a menu and prompt the user to select one from the list? The task is very easy to implement using IO::Prompt: =pod code use IO::Prompt; my @names = qw( foo bar baz qux ); my $selected_name

Replace digit by equivalent in words.

2010-10-12 Thread pawan kumar
Hi Folks, I need an help.I am trying to read the file contents line by line and if there are any number in the word (like 1,2,...) then i hav to replace that digit by its equivalent in terms of words. Ex:if input is hi*5*go Output has to be hi*five*go..This changes has

Re: Replace digit by equivalent in words.

2010-10-12 Thread Jon Hermansen
, I need an help.I am trying to read the file contents line by line and if there are any number in the word (like 1,2,...) then i hav to replace that digit by its equivalent in terms of words. Ex:if input is hi*5*go Output has to be hi*five*go..This changes has to be reflected in original

Perl equivalent to UNIX's EOF and EOF pair

2010-02-10 Thread newbie01 perl
Hi all, We are in the process of changing UNIX and MS-DOS scripts into Perl, mostly UNIX scripts and there are a lot of codes that uses the EOF and EOF pair. Am just wanting to know if there are better alternative to what I've been doing so far. Example of these are as below: Example 01: UNIX

Re: Perl equivalent to UNIX's EOF and EOF pair

2010-02-10 Thread Jim Gibson
On 2/10/10 Wed Feb 10, 2010 3:07 PM, newbie01 perl newbie01.p...@gmail.com scribbled: Hi all, We are in the process of changing UNIX and MS-DOS scripts into Perl, mostly UNIX scripts and there are a lot of codes that uses the EOF and EOF pair. Am just wanting to know if there are better

Re: Perl equivalent to UNIX's EOF and EOF pair

2010-02-10 Thread newbie01 perl
Hi Jim, Thanks for your advise ... Am currently having issues with using DBI and DBD and is constrained on installing new DBI versions so at the moment my only option is to shell out. If I can get a fix on using DBI/DBD where I do not need to supply username and password, then I will check

Re: Perl equivalent to UNIX's EOF and EOF pair

2010-02-10 Thread Jim Gibson
On 2/10/10 Wed Feb 10, 2010 5:53 PM, newbie01 perl newbie01.p...@gmail.com scribbled: Hi Jim, Thanks for your advise ... Am currently having issues with using DBI and DBD and is constrained on installing new DBI versions so at the moment my only option is to shell out. If I can get a

Re: Perl equivalent of PHP globals?

2008-10-25 Thread Chas. Owens
On Fri, Oct 24, 2008 at 22:12, Kelly Jones [EMAIL PROTECTED] wrote: How can I see all the local, global, etc Perl variables defined at a given point in my program? snip Take a look at PadWalker*. * http://search.cpan.org/dist/PadWalker/PadWalker.pm -- Chas. Owens wonkden.net The most

Perl equivalent of PHP globals?

2008-10-24 Thread Kelly Jones
How can I see all the local, global, etc Perl variables defined at a given point in my program? -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile.

Re: Perl equivalent of PHP globals?

2008-10-24 Thread Jeff Pang
2008/10/25 Kelly Jones [EMAIL PROTECTED]: How can I see all the local, global, etc Perl variables defined at a given point in my program? see this: http://perl.plover.com/FAQs/Namespaces.html -- Jeff Pang http://home.arcor.de/pangj/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

SSH equivalent to Net::Telnet::Cisco?

2008-10-07 Thread Paul
I've searched CPAN, but have not found an equivalent module such as Net::Telnet::Cisco for SSH (SSH2). Is there one somewhere out there? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

SSH equivalent to Net::Telnet::Cisco?

2008-10-06 Thread Paul
I've searched CPAN, but have not found an equivalent module such as Net::Telnet::Cisco for SSH (SSH2). Is there one somewhere out there? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: SSH equivalent to Net::Telnet::Cisco?

2008-10-06 Thread Rodrick Brown
Have you tried the standard Net::SSH does it not work with cisco devices? On Mon, Oct 6, 2008 at 1:22 PM, Paul [EMAIL PROTECTED] wrote: I've searched CPAN, but have not found an equivalent module such as Net::Telnet::Cisco for SSH (SSH2). Is there one somewhere out there? Thanks

Re: Perl equivalent of the unix time command

2008-09-14 Thread yitzle
On Sun, Sep 7, 2008 at 3:44 PM, Melroy [EMAIL PROTECTED] wrote: Hi all, Is there a perl equiavelnt of the unix time command to find out how long a given process takes to run? google search revealed no help. The only thing I found was the times command, but I don't think it does what I want.

Re: Perl equivalent of Unix time command

2008-09-08 Thread Raymond Wan
of code. Then, take the difference and convert the result from seconds to whatever you want. Ray Melroy wrote: Hi all, I want to benchmark a bunch of running processes using Perl , but I could not find any equivalent for the unic time coammnd in perl? Can someone point to me

Perl equivalent of Unix time command

2008-09-07 Thread Melroy
Hi all, I want to benchmark a bunch of running processes using Perl , but I could not find any equivalent for the unic time coammnd in perl? Can someone point to me if such a function exists in perl? The only command I found was times, but I don't know how to use it. doing a websearch did not help

Perl equivalent of the unix time command

2008-09-07 Thread Melroy
Hi all, Is there a perl equiavelnt of the unix time command to find out how long a given process takes to run? google search revealed no help. The only thing I found was the times command, but I don't think it does what I want. (Basically I want to find out how long a given process takes to run

Re: Perl equivalent of Unix time command

2008-09-07 Thread Mr. Shawn H. Corey
On Sun, 2008-09-07 at 09:30 -0700, Melroy wrote: Hi all, I want to benchmark a bunch of running processes using Perl , but I could not find any equivalent for the unic time coammnd in perl? Can someone point to me if such a function exists in perl? The only command I found was times, but I

Re: Perl equivalent of Unix time command

2008-09-07 Thread Jeff Pang
2008/9/8 Melroy [EMAIL PROTECTED]: Hi all, I want to benchmark a bunch of running processes using Perl , but I could not find any equivalent for the unic time coammnd in perl? Can someone point to me if such a function exists in perl? use Benchmark::Timer; http://search.cpan.org/~dcoppit

Perl equivalent of sed -f or awk -f

2008-09-02 Thread [EMAIL PROTECTED]
I'd like to apply a series of inline edits to a file in Perl. With sed, I could use sed -f commandfile inputfile or in awk, awk - f commandfile inputfile, however, I could not find an equivalent in Perl. I'd prefer not to use sed or awk as they do not support inline editing directly. In Perl

RE: Perl equivalent of sed -f or awk -f

2008-09-02 Thread Andrew Curry
Perl -p -i -e s/search/replace/extras; FILENAME -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 02 September 2008 15:06 To: beginners@perl.org Subject: Perl equivalent of sed -f or awk -f I'd like to apply a series of inline edits to a file in Perl. With sed

Re: Perl equivalent of sed -f or awk -f

2008-09-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: I'd like to apply a series of inline edits to a file in Perl. With sed, I could use sed -f commandfile inputfile or in awk, awk - f commandfile inputfile, however, I could not find an equivalent in Perl. perl commandfile inputfile I'd prefer not to use sed or awk

Re: Perl equivalent of sed -f or awk -f

2008-09-02 Thread [EMAIL PROTECTED]
On Sep 2, 10:49 am, [EMAIL PROTECTED] (John W. Krahn) wrote: [EMAIL PROTECTED] wrote: I'd like to apply a series of inline edits to a file in Perl. With sed, I could use sed -f commandfile inputfile or in awk, awk - f commandfile inputfile, however, I could not find an equivalent in Perl

Re: DBI equivalent of Oraperl ora_titles function !

2008-08-06 Thread Amit Saxena
On Tue, Aug 5, 2008 at 6:06 PM, Peter Scott [EMAIL PROTECTED] wrote: On Tue, 05 Aug 2008 09:38:41 +0530, Amit Saxena wrote: What's the DBI equivalent of Oraperl ora_titles function ? I need it because I want to get the titles (column names) of a select query into an array without

Re: DBI equivalent of Oraperl ora_titles function !

2008-08-05 Thread Peter Scott
On Tue, 05 Aug 2008 09:38:41 +0530, Amit Saxena wrote: What's the DBI equivalent of Oraperl ora_titles function ? I need it because I want to get the titles (column names) of a select query into an array without fetching the row values from the database. I believe you want the NAME

DBI equivalent of Oraperl ora_titles function !

2008-08-04 Thread Amit Saxena
Hi all, What's the DBI equivalent of Oraperl ora_titles function ? I need it because I want to get the titles (column names) of a select query into an array without fetching the row values from the database. Thanks Regards, Amit Saxena

What is the perl equivalent of a bash -xv? Verbose and expand while executing?

2008-03-13 Thread Kenneth Wolcott
Hi; What is the perl equivalent of a #!/bin/bash -xv? I'd like to have verbose (print each line prior to execution) and expand each variable prior to execution while executing? How do I run perl in debug mode non-interactively, dumping every variable when it gets modified? How do I get

Re: What is the perl equivalent of a bash -xv? Verbose and expand while executing?

2008-03-13 Thread Chas. Owens
On Thu, Mar 13, 2008 at 7:09 PM, Kenneth Wolcott [EMAIL PROTECTED] wrote: Hi; What is the perl equivalent of a #!/bin/bash -xv? I'd like to have verbose (print each line prior to execution) and expand each variable prior to execution while executing? How do I run perl in debug mode non

Re: [PBML] What is the perl equivalent of a bash -xv? Verbose and expand while executing?

2008-03-13 Thread Randal L. Schwartz
Kenneth == Kenneth Wolcott [EMAIL PROTECTED] writes: Kenneth How do I get the answers to either or both of these questions using Kenneth perldoc? By searching the perlfaq. perldoc perldoc will tell you how to use perldoc, and from there, you can get the searches. -- Randal L. Schwartz -

What is equivalent to awk's FNR (line number per crnt file)

2007-12-02 Thread reader
Seems that I recall perl having a built in like awk's FNR that keeps track of the current line number in each file. Zeros out on each new file. Like $. only goes to zero on each new file. I know how to do that with code but wondered if perl already does it thru some builtin. -- To

Re: What is equivalent to awk's FNR (line number per crnt file)

2007-12-02 Thread Yitzchok Good
perldoc - perlvar $. is reset when the filehandle is closed, but not when an open filehandle is reopened without an intervening close(). For more details, see I/O Operators in perlop. Because never does an explicit close, line numbers increase across ARGV files (but see examples in eof). You

Re: Convert Scientific Notation to decimal equivalent

2007-07-21 Thread Dr.Ruud
Xavier Noria schreef: Detecting whether something holds in an array is the job of grep: my $numbers = grep /\A$RE{num}{real}\z/, @data; next unless $numbers == @data; Alternative: die if grep !/\A$RE{num}{real}\z/, @data; my $numbers = scalar @data; -- Affijn, Ruud Gewoon

Re: Convert Scientific Notation to decimal equivalent

2007-07-19 Thread Xavier Noria
, and $ allows an optional trailing newline. When I want to match a complete string exactly, I tend to use \A and \z because they convey that intention clearly. If your code processes line by line and splits on whitespace, \A ... \z is equivalent to ^ ... $. In my case, I am checking an array

Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Joseph L. Casale
How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0 14.95313 1.570813E-015 0 14.95313 -14.45313 0 -14.95313 -28.90625 0 -14.95313 -14.45313 0 -14.95313

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Chas Owens
On 7/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote: How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0 14.95313 1.570813E-015 0 14.95313 -14.45313 0 -14.95313

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread John W. Krahn
Joseph L. Casale wrote: How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0 14.95313 1.570813E-015 0 14.95313 -14.45313 0 -14.95313 -28.90625 0 -14.95313

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Xavier Noria
El Jul 18, 2007, a las 11:19 PM, Joseph L. Casale escribió: How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0 14.95313 1.570813E-015 0 14.95313 -14.45313

RE: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Joseph L. Casale
Notation to decimal equivalent El Jul 18, 2007, a las 11:19 PM, Joseph L. Casale escribió: How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0 14.95313

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Chas Owens
On 7/18/07, Chas Owens [EMAIL PROTECTED] wrote: On 7/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote: How can I detect this, I have been running some code for a few days to develop some files and ran into the situation where I am getting the following data for input: 14.95313 14.45312 0

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Chas Owens
On 7/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Interesting, I see from your regexp you use a \A and \z, from Perldoc this means: \A Match only at beginning of string \z Match only at end of string Is foo10bar valid? /^$RE{num}{real}$/ says no, but /$RE{num}{real}/ says yes.

RE: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Joseph L. Casale
Subject: Re: Convert Scientific Notation to decimal equivalent On 7/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Interesting, I see from your regexp you use a \A and \z, from Perldoc this means: \A Match only at beginning of string \z Match only at end of string Is foo10bar valid

Re: Convert Scientific Notation to decimal equivalent

2007-07-18 Thread Chas Owens
On 7/18/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Chas, Sorry but I am not clear on what you mean by reduce? Do you mean remove all non numbers from the array? snip Sort of, the code doesn't modify the original array, it creates a new array with only the values that are numbers. -- To

Perl equivalent of Include

2007-07-06 Thread Ray
Hi, I would like to create module of common sub routines and corresponding global variables. I'm trying to use use and/or require but it looks like I have to do extra coding to make variables defined in my module file to be accessible to the .pl files that are using the module file. Can someone

Re: Perl equivalent of Include

2007-07-06 Thread Tom Phoenix
On 7/6/07, Ray [EMAIL PROTECTED] wrote: I would like to create module of common sub routines and corresponding global variables. That's how most modules start; you're on the right track. I'm trying to use use and/or require but it looks like I have to do extra coding to make variables

Is there a perl equivalent to PHP variables $_POST and $_GET?

2007-06-11 Thread On Ali
Is there a perl equivalent to PHP variables $_POST and $_GET? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Is there a perl equivalent to PHP variables $_POST and $_GET?

2007-06-11 Thread Xavier Noria
On Jun 10, 2007, at 9:18 PM, On Ali wrote: Is there a perl equivalent to PHP variables $_POST and $_GET? Perl is a general-purpose programming language and does not have web stuff builtin. To do web programming you need to pick some library/ framework like CGI.pm or Catalyst for example

Re: Is there a perl equivalent to PHP variables $_POST and $_GET?

2007-06-11 Thread Ovid
- Original Message From: On Ali [EMAIL PROTECTED] Is there a perl equivalent to PHP variables $_POST and $_GET? It would be easy to create, but what you really want is the CGI module: #!/usr/bin/perl use strict; use warnings; use CGI ':standard'; my $id= param('id

Re: Is there a perl equivalent to PHP variables $_POST and $_GET?

2007-06-11 Thread Tom Allison
. On Jun 10, 2007, at 3:18 PM, On Ali wrote: Is there a perl equivalent to PHP variables $_POST and $_GET? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: basename equivalent?

2007-04-27 Thread Nishi
I am having issues using File::Basename via cygwin perl. Is there a workaround for that? On 4/26/07, Xavier Noria [EMAIL PROTECTED] wrote: On Apr 26, 2007, at 2:34 AM, Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path

Re: basename equivalent?

2007-04-27 Thread Nishi
The issue is when i use cygwin Perl. On 4/27/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/27/07, Nishi [EMAIL PROTECTED] wrote: I am having issues using File::Basename via cygwin perl. Is there a workaround for that? Are you using cygwin's Perl or Activestate's Perl?

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Nishi [EMAIL PROTECTED] wrote: The issue is when i use cygwin Perl. And the specific issue is what? I have just installed cygwin on an XP box and wrote this script: #!/usr/bin/perl use strict; use warnings; use File::Basename; for my $path (qw{c:\foo\bar\baz.txt

Re: basename equivalent?

2007-04-27 Thread Nishi
This is what i see c:\foo\bar\baz.txt - c:\foo\bar\baz.txt /cygdrive/c/foo/bar/baz.txt - baz.txt which is different from your output. On 4/27/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/27/07, Nishi [EMAIL PROTECTED] wrote: The issue is when i use cygwin Perl. And the specific issue

Re: basename equivalent?

2007-04-27 Thread Nishi
So, I see the below output (that is diff than yours) when i run from cygwin. If I run from the cmd prompt, I see the same output as yours. On 4/27/07, Nishi [EMAIL PROTECTED] wrote: This is what i see c:\foo\bar\baz.txt - c:\foo\bar\baz.txt /cygdrive/c/foo/bar/baz.txt - baz.txt which is

Re: basename equivalent?

2007-04-27 Thread Nishi
So, calling the perl script explicitly as in %ACTIVESTATEPERL%\bin\perl.exe solves my issue in the cygwin environment. On 4/27/07, Nishi [EMAIL PROTECTED] wrote: So, I see the below output (that is diff than yours) when i run from cygwin. If I run from the cmd prompt, I see the same output

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Nishi [EMAIL PROTECTED] wrote: So, calling the perl script explicitly as in %ACTIVESTATEPERL%\bin\perl.exe solves my issue in the cygwin environment. snip I think there is some confusion here. You cannot be running %ACTIVESTATEPERL%\bin\perl.exe from the cygwin environment as

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/27/07, Nishi [EMAIL PROTECTED] wrote: So, calling the perl script explicitly as in %ACTIVESTATEPERL%\bin\perl.exe solves my issue in the cygwin environment. snip I think there is some confusion here. You cannot be running

Re: basename equivalent?

2007-04-27 Thread Nishi
I thing that I forgot to mention here is that I am calling the perl commands within a batch script. So I pass ACTIVESTATEPERL to the perl within the batch script and the bat file is run within the cygwin environment. Thanks, Nishi. On 4/27/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/27/07,

Re: basename equivalent?

2007-04-26 Thread Xavier Noria
On Apr 26, 2007, at 2:34 AM, Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? File::Basename is a standard module, why you don't want to use it? -- fxn -- To unsubscribe, e-mail

basename equivalent?

2007-04-25 Thread Nishi
Hi: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Thanks!

Re: basename equivalent?

2007-04-25 Thread John W. Krahn
Nishi wrote: Hi: Hello, What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Assuming that your file system uses / as the path separator: ( my

Re: basename equivalent?

2007-04-25 Thread Rob Dixon
Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Why don't you try it?! It wouldn't work because $fileName would end up

Re: basename equivalent?

2007-04-25 Thread Nishi
On 4/25/07, John W. Krahn [EMAIL PROTECTED] wrote: Nishi wrote: Hi: Hello, What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Assuming

Re: basename equivalent?

2007-04-25 Thread Chas Owens
On 4/25/07, Nishi [EMAIL PROTECTED] wrote: Hi: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Thanks! There are many options, but none

Re: basename equivalent?

2007-04-25 Thread Nishi
Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Why don't you try

Re: basename equivalent?

2007-04-25 Thread yitzle
my ($name) = $path =~ m|([^/]+)$|; Shouldn't that be a =~ s|([^/]+)$|; not m? On 4/26/07, Nishi [EMAIL PROTECTED] wrote: Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get

Re: basename equivalent?

2007-04-25 Thread Chas Owens
On 4/26/07, Nishi [EMAIL PROTECTED] wrote: Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my

Re: basename equivalent?

2007-04-25 Thread Mumia W.
On 04/25/2007 11:59 PM, Nishi wrote: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: [...] my ($name) = $path =~ m|([^/]+)$|; I tried it, but somehow doesnt work for me, printing $name returns me the entire string such as C:\temp\abc\abc.txt and not abc.txt. Am I missing something?

Re: perl -e equivalent of short script...

2007-03-22 Thread Alan Campbell
hello, Good questions. I'm trying to use cmd line perl -e to do some fairly basic sed-style find/replace. Why don't you just use sed for that, if you're not doing the main program in Perl? Maybe I'm misunderstanding you, but it sounds like you're saying that you're writing shell scripts in

Re: perl -e equivalent of short script...

2007-03-22 Thread Tom Phoenix
On 3/22/07, Alan Campbell [EMAIL PROTECTED] wrote: true, but I'm tweaking the orig array in-place. So how to modify a given element if I dont have some index? With foreach, you don't need an index. The control variable of a foreach isn't a copy of the array element; it *is* the element of

Re: perl -e equivalent of short script...

2007-03-22 Thread Chas Owens
On 3/22/07, Alan Campbell [EMAIL PROTECTED] wrote: sounds like advice is to not bother w/ perl -e. Seems a pity. Looked like a perfect job for perl -e but perhaps its pushing it a bit. I think the advice is not so much not to use perl -e, but rather that you should be using Perl for the

perl -e equivalent of short script...

2007-03-21 Thread Alan Campbell
hello folks, I'm trying to use cmd line perl -e to do some fairly basic sed-style find/replace. Was able to get first few things working but stumbled when I wanted to do the following - given an i/p (piped o/p from a previous perl -e cmd on DOS) of... dtor_list.obj: newnothrow.obj:

Re: perl -e equivalent of short script...

2007-03-21 Thread Tom Phoenix
On 3/21/07, Alan Campbell [EMAIL PROTECTED] wrote: I'm trying to use cmd line perl -e to do some fairly basic sed-style find/replace. Why don't you just use sed for that, if you're not doing the main program in Perl? Maybe I'm misunderstanding you, but it sounds like you're saying that

Re: What's the Perl equivalent of this PHP contruct?

2007-03-02 Thread Randall
Very close! I used PHP::Serialization as Data::Dumper generated the serialized object in a different format that PHP cannot read directly. Now it works perfectly, thank you so much! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What's the Perl equivalent of this PHP contruct?

2007-03-02 Thread Randall
Are you trying to dump the data from perl and then read it in php. ? Yes. And I followed the example in Robert Boone's reply and now it works. Thanks to everyone. Problem solved. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Randall
Hello, I've translated the following PHP snippet: $data = array(); $num = 0; $data[$num]['title'] = 'Name'; $data[$num]['data'] = 'Randall'; $num++; $data[$num]['title'] = 'Email'; $data[$num]['data'] = '[EMAIL PROTECTED]'; $num++; As this Perl: my @data; my $num = 0; $data[$num]['title']

Re: What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Traeder, Philipp
On Thursday 01 March 2007 06:52, Randall wrote: I've translated the following PHP snippet: $data = array(); $num = 0; $data[$num]['title'] = 'Name'; $data[$num]['data'] = 'Randall'; $num++; As this Perl: my @data; my $num = 0; $data[$num]['title'] = 'Name'; $data[$num]['data']

Re: What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Randall
you'll need to write both PHP arrays as hashes in Perl Thanks for the help, but it didn't work at all :-( nothing could be read from the PHP side. Any ideas? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Robert Boone
On Mar 1, 2007, at 10:51 AM, Traeder, Philipp wrote: On Thursday 01 March 2007 06:52, Randall wrote: I've translated the following PHP snippet: $data = array(); $num = 0; $data[$num]['title'] = 'Name'; $data[$num]['data'] = 'Randall'; $num++; As this Perl: my @data; my $num = 0;

Re: What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Madan Kumar Nath
Hello , Are you trying to dump the data from perl and then read it in php. ? Madan Randall wrote: you'll need to write both PHP arrays as hashes in Perl Thanks for the help, but it didn't work at all :-( nothing could be read from the PHP side. Any ideas? -- To

php's __FUNCTION__ equivalent in Perl

2007-01-02 Thread Bram Kuijper
Hi all, Is there some type of equivalent to PHP's __FUNCTION__ magical constant in Perl, with which you can get the current function's name within the function's body? The list of perl predefined variables from Larry Wall's book does provide a __FILE__ constant, but apparently

Re: php's __FUNCTION__ equivalent in Perl

2007-01-02 Thread Ovid
--- Bram Kuijper [EMAIL PROTECTED] wrote: Hi all, Is there some type of equivalent to PHP's __FUNCTION__ magical constant in Perl, with which you can get the current function's name within the function's body? The list of perl predefined variables from Larry Wall's book does

Re: Perl equivalent of PHP extract()?

2006-12-18 Thread Ovid
--- Kelly Jones [EMAIL PROTECTED] wrote: Inside a subroutine, I want to use this hash: %hash = (apple = red, pear = green, [EMAIL PROTECTED] = yellow); to set my($apple)=red, my($pear)=green, my($lemon)=yellow [getting rid of the junk '@' and '!' chars in the key] As noted, you

Perl equivalent of PHP extract()?

2006-12-17 Thread Kelly Jones
Inside a subroutine, I want to use this hash: %hash = (apple = red, pear = green, [EMAIL PROTECTED] = yellow); to set my($apple)=red, my($pear)=green, my($lemon)=yellow [getting rid of the junk '@' and '!' chars in the key] This is approximately what PHP's extract() does. This almost works:

Re: Perl equivalent of PHP extract()?

2006-12-17 Thread John W. Krahn
Kelly Jones wrote: Inside a subroutine, I want to use this hash: %hash = (apple = red, pear = green, [EMAIL PROTECTED] = yellow); So just use the hash. to set my($apple)=red, my($pear)=green, my($lemon)=yellow [getting rid of the junk '@' and '!' chars in the key] Just use the hash.

Re: [PBML] Perl equivalent of PHP extract()?

2006-12-17 Thread Randal L. Schwartz
Kelly == Kelly Jones [EMAIL PROTECTED] writes: Kelly Inside a subroutine, I want to use this hash: Kelly %hash = (apple = red, pear = green, [EMAIL PROTECTED] = yellow); Kelly to set my($apple)=red, my($pear)=green, my($lemon)=yellow Kelly [getting rid of the junk '@' and '!' chars in the key]

perl equivalent of ps

2005-10-16 Thread Christopher Spears
Does Perl have the equivalent of ps in Unix? I've looked in my Programming Perl book, and I could only find getpgrp, which does the opposit of what I want to do. Here is a schematic of what I want to accomplish: 1) Search ps aux and locate process PROC. 2) Get PROC's PID. 3) Use the PID to kill

Re: perl equivalent of ps

2005-10-16 Thread Edward WIJAYA
On Sun, 16 Oct 2005 22:14:05 +0800, Christopher Spears [EMAIL PROTECTED] wrote: Does Perl have the equivalent of ps in Unix? Check out Proc::ProcessTable module They have nice API for it. or can you try this? perl -e'print `ps --no-header -p$$ -osz`' This is just an example snippet

Re: perl equivalent of ps

2005-10-16 Thread John W. Krahn
Christopher Spears wrote: Does Perl have the equivalent of ps in Unix? No. I've looked in my Programming Perl book, and I could only find getpgrp, which does the opposit of what I want to do. Here is a schematic of what I want to accomplish: 1) Search ps aux and locate process PROC. 2

Perl equivalent of JavaScript match

2005-10-11 Thread Frank Geueke, III
Hi. I need to grab regex matches from a string in perl. The string is an enum data type in Mysql. i.e. enum('Berks','Carbon','Lehigh','Montgomery') So basically I need a match on alphabetic chars between single quotes. No problem. But I'd like to be able to grab each match and store it in an

Re: Perl equivalent of JavaScript match

2005-10-11 Thread Todd W
Frank Geueke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi. I need to grab regex matches from a string in perl. The string is an enum data type in Mysql. i.e. enum('Berks','Carbon','Lehigh','Montgomery') So basically I need a match on alphabetic chars between single quotes.

Re: Perl equivalent of JavaScript match

2005-10-11 Thread Angshu Kar
Hi Todd, I'm completely new to perl. I'm have to work in biology using perl, postgresql (as database) and clustalw or multalin (as the alignment tool). I'm stating my problem briefly: In the postgresql db the data is clustered using complete linkage clustering. I've to connect to that db, fetch

PERL's equivalent to an include file

2005-09-27 Thread Shelly Brown
I would like to include a PERL file within an html or asp file. How do I do that? I'm working on a Windows server. -- Shelly Brown

Re: PERL's equivalent to an include file

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Shelly Brown wrote: I would like to include a PERL file within an html or asp file. How do I do that? I'm working on a Windows server. You're looking for a templating framework. Perl offers several, including: Template Toolkit (TT) HTML::Template HTML::Mason (or

Re: PERL's equivalent to an include file

2005-09-27 Thread Shelly Brown
I would like to display the daily calendar information from a perl script: http://webapps.sbuniv.edu/daycal/ within an html page so it looks like this: http://www.sbuniv.edu/. Right now I have to manually enter the calendar information. I would like for it to be dynamic. Make sense? On 9/27/05,

Re: PERL's equivalent to an include file

2005-09-27 Thread Wiggins d'Anconia
Please bottom post... Shelly Brown wrote: I would like to display the daily calendar information from a perl script: http://webapps.sbuniv.edu/daycal/ within an html page so it looks like this: http://www.sbuniv.edu/. Right now I have to manually enter the calendar information. I would like

Re: PERL's equivalent to an include file

2005-09-27 Thread Chris Devers
has an equivalent to SSI, but iframe will work anywhere. -- Chris Devers ’$폡^t[ê(B -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

  1   2   >