Hi all,
I want get the last part of this sentence excluding @@
i.e i should get my output in a variable($put) like this for the following
sentence:
EnternalID_GetDateofBirth.vbp
M:\jav_test\Technical_Docs\.@@\main\int_1_2b\techdoc_1_2b\2\Common_Controls\
main\int_1_2b\techdoc_1_2b\1\Code_Exam
On Oct 9, stanley said:
>sub givename(%a)
DO NOT try to put variables in the declaration of a function. Unless you
are into HEAVY MAGIC, your subroutine declarations (or definitions) should
look like
sub function_name {
# ...
}
No () there. When you CALL the function, THEN you use ()
On Wed, 9 Oct 2002, stanley wrote:
>
> how can i pass a hash variable to a subrotine?
>
> such as
>
> %a=(m=>1,n=>2);
>
> %b=(k=>4,j=>6);
>
> sub givename(%a)
>
> {
>
> #here how can make %c get the subroutine argument(a hash variable))
>
> my %c=???;
>
> print %c;
>
> }
Read through
p
how can i pass a hash variable to a subrotine?
such as
%a=(m=>1,n=>2);
%b=(k=>4,j=>6);
sub givename(%a)
{
#here how can make %c get the subroutine argument(a hash variable))
my %c=???;
print %c;
}
-
Do you Yahoo!?
Faith Hill - Exclusive Performances, Vi
Hello,
Can someone help me with creating a script to return certain information from a
Postgres database to a drop down box on a webpage?
#!/usr/bin/perl
use CGI;
use DBI;
#Define connection values
$DBSource = 'dbi:Pg:dbname=mydb';
$DBUsername = 'test';
$DBAuth = 'test';
#Open db connection
Nyimi Jose wrote:
>> The Browser's interface cannot contain all the features and rings
>> and bells a normal GUI can (unless you use Java and use the browser
>> just to download and host the application)
>
> What about Perl for the aforementioned functionality.
> It's seems that Java is the Guru
On Wed, Oct 09, 2002 at 07:55:13PM -0700, stanley wrote:
> #!/usr/bin/perl -w
>
> does it still throw an exception or do the warnings work?
-w on the shebang or command lines will work with any version of Perl. The
use warnings pragma was added in 5.6.0, and this is why you're getting the
error
Todd
how do you turn off the warning ?
stanley
>
> i use solaris and ihave no root right.the version of perl5.005_03
>
> in a simple script if i try to add "use warnings",it will say Can't locate
> warnings in @inc(@inc..)
>
> instead if i use perl -w my.pl,it will give me the warning inf
both #!/usr/bin/perl -w and perl -w my.pl will do the warnings work,but
use warnings will throw exception.
if i setup a file called warnings.pm(it only conatins 1) in my lib and don't use
directive or option,there is no warning and exception
stanley
nkuipers wrote: If you put the -w flag in
Stanley wrote:
>
> i use solaris and ihave no root right.the version of perl5.005_03
>
> in a simple script if i try to add "use warnings",it will say Can't locate
> warnings in @inc(@inc..)
>
> instead if i use perl -w my.pl,it will give me the warning information. so
> how can i modify m
i use solaris and ihave no root right.the version of perl5.005_03
in a simple script if i try to add "use warnings",it will say Can't locate warnings in
@inc(@inc..)
instead if i use perl -w my.pl,it will give me the warning information. so how can i
modify my configuration or what module
Thanks a lot for the advice! I'll factor this into my thinking and see
what I come up with.
James
On Wednesday, October 9, 2002, at 07:07 PM, david wrote:
> James Edward Gray II wrote:
>
>>
>> On Wednesday, October 9, 2002, at 05:15 PM, david wrote:
>>
>>> just curious:
>>> if you want chil
P Lerenard wrote:
>
> Hi,
Hello,
> @array = qx{egrep -n '\{' file);
> foreach $el (@array)
> {
> ($num,@other} = split(/\:/,$el);
> $thenum{$num} = $num;
> }
>
> foreach $ele (sort keys %thenum)
> {
> print"$ele\n";
> }
> except this one sort by string and not by integer, so 100 is before 99
>
James Edward Gray II wrote:
>
> On Wednesday, October 9, 2002, at 05:15 PM, david wrote:
>
>> just curious:
>> if you want child's functionality, why wouldn't you want to have the
>> child
>> object in the first place?
>
> Glad, you asked; I would love a second opinion! My server manages
> v
On Thu, Oct 10, 2002 at 12:01:31AM +, Kyle Babich wrote:
> %up = {
> 'kyle' => 123,
> 'jason' => 123,
> 'chelsea' => 123,
> 'john' => 123,
> 'cheryl' => 123
> };
This is your problem. You've constructed an anonymous hash and assigned it
to %up. You should be using parens, not curl
Nkuipers <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> The following is from page 75 in the Camel:
>
> "List assignment in scalar context returns the number of elements
> produced by the expression on the right side of the
> assignment:
>
> $x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
After trying my hand at perl, realizing it was above my head, going back
at starting with python, and now trying again at perl this is my first
(failed) attempt at a user-pass program attempt, except it never accepts
the username. What is wrong with it?
%up = {
'kyle' => 123,
'jason' => 123,
On Wednesday, October 9, 2002, at 05:15 PM, david wrote:
> just curious:
> if you want child's functionality, why wouldn't you want to have the
> child
> object in the first place?
Glad, you asked; I would love a second opinion! My server manages
vanilla Telnet connections with a Connection
On Wed, Oct 09, 2002 at 03:22:20PM -0700, nkuipers wrote:
> The following is from page 75 in the Camel:
>
> "List assignment in scalar context returns the number of elements produced by
> the expression on the right side of the assignment:
>
> $x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
>
Nkuipers wrote:
> The following is from page 75 in the Camel:
>
> "List assignment in scalar context returns the number of elements produced
> by the expression on the right side of the assignment:
>
> $x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
>
can you guess what $x is now:
$x = ($a,
James Edward Gray II wrote:
> If I have an object and I want to increase it's functionality by
> "upgrading/promoting" it to a subclass if certain conditions are met
> during a method call, could/should I use something like:
>
> sub some_method {
> my $self = $_[0];
>
> # ...
>
> if (PROMOTE_C
The following is from page 75 in the Camel:
"List assignment in scalar context returns the number of elements produced by
the expression on the right side of the assignment:
$x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
"
why. how.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
On Wed, Oct 09, 2002 at 02:16:52PM -0700, nkuipers wrote:
> When I first saw this, I worked out the assignment where $a and $b each
> get a 7 and the third 7 is discarded, then $x gets the last value in the
> list of $a and $b because of the comma operator for list literals in a
> scalar context..
Hello everyone,
The following is from page 75 in the Camel:
"List assignment in scalar context returns the number of elements produced by
the expression on the right side of the assignment:
$x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
"
It goes on to explain how this is useful but fr
thank you all
special thanks for the first 3 on the podium
Pierre
>From: "Mark Anderson" <[EMAIL PROTECTED]>
>To: "P lerenard" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>Subject: RE: sort a hash
>Date: Wed, 9 Oct 2002 13:28:40 -0700
>
>see bottom...
>
>-Original Message-
>From: P lerena
thank you all
really really quik answer
Pierre
>From: Michael Fowler <[EMAIL PROTECTED]>
>To: P lerenard <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: sort a hash
>Date: Wed, 9 Oct 2002 12:33:28 -0800
>
>On Wed, Oct 09, 2002 at 08:21:27PM +, P lerenard wrote:
> > except this one
On Wed, Oct 09, 2002 at 08:21:27PM +, P lerenard wrote:
> except this one sort by string and not by integer, so 100 is before 99
> Do you have an idea to sort that by interger and not by string, 99 before
> 100?
See perldoc -f sort. It has many fine examples of how to sort various types
of
thanks working fine
>From: "Wagner, David --- Senior Programmer Analyst --- WGO"
><[EMAIL PROTECTED]>
>To: 'P lerenard' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: RE: sort a hash
>Date: Wed, 9 Oct 2002 15:25:23 -0500
>
> Replace the following
> foreach $ele (sort keys %thenum
see bottom...
-Original Message-
From: P lerenard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: sort a hash
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$num} = $num;
}
foreac
Replace the following
foreach $ele (sort keys %thenum
with
foreach $ele (sort {$a <=> $b} keys %thenum)
This will do ascending numeric or if descending switch the a and b around.
Wags ;)
-Original Message-
From: P lerenard [mailto:[EMAIL PROTECTED]]
Sent: Wednes
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$num} = $num;
}
foreach $ele (sort keys %thenum)
{
print"$ele\n";
}
except this one sort by string and not by integer, so 100 is before 99
Do you have an idea to sort that by interger and not by
On Wed, Oct 09, 2002 at 02:28:58AM -0700, Hello Buddy wrote:
> What I am facing now is when I write to format text file, suppose I was
> currently in line 10 for my formatted text file and I want to append some
> word in line 5 of formatted text file.
Please see perldoc -q "line in a file", or
ht
--- James Edward Gray II <[EMAIL PROTECTED]> wrote:
> If I have an object and I want to increase it's functionality by
> "upgrading/promoting" it to a subclass if certain conditions are met
> during a method call, could/should I use something like:
>
> sub some_method {
> my $self = $_[0]
On Wed, Oct 09, 2002 at 02:34:49PM -0500, James Edward Gray II wrote:
> If I have an object and I want to increase it's functionality by
> "upgrading/promoting" it to a subclass if certain conditions are met
> during a method call, could/should I use something like:
>
> sub some_method {
>
If I have an object and I want to increase it's functionality by
"upgrading/promoting" it to a subclass if certain conditions are met
during a method call, could/should I use something like:
sub some_method {
my $self = $_[0];
# ...
if (PROMOTE_CONDITION) {
Jean Padilla <[EMAIL PROTECTED]> wrote:
> Hi, pravesh
> 1 - You are saying "mv < 2 - a file handle is *not* to be confused with a file name
Actually - Perl will let you do
our $FH = 'path';
open FH or die...; # open FH, '<', $FH
Doesn't work with 'my' variables, though.
> try :
>
> my $f
Supplying module names makes answering it easier to give a better answer.
Idiomatically, $self usually refers to the scalar being blessed into a class,
in other words, an object. So $self->verbose is indeed calling a method on
the object using the indirect syntax, though whether or not this m
It might help to say what module you found it in, since that would supply more
context. Most generally, it looks like $RIDLINE is going to be put into a
regular expression, perhaps something along the lines of
m/$RIDLINE/
If you are asking about the \s+ sort of notation, then you need to read
what is the meaning of $RIDLINE = 'RID\s+=\s+(\d+-\d+-\d+)';
i found it from the begin block of a module.
thanks
-
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
Hello,
The documentation for GetOpt::Long on CPAN includes a section on configuring
the module. Several properties of interest to be configured are auto_abbrev,
bundling, and bundling_override. Says the blurb on the bundling description,
for example:
Enabling this option will allow single-c
from some modules,i found this expression " if ($self->verbose) ".
is this verbose is a special method or something else?
thanks
-
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
Robert Citek wrote:
>
> Can someone show me an example of how I can mix long and short options with
> Getopt?
>
> I would like to pass options to a perl script that can take both short and
> long options. For example, all of these commands work (this is GNU tar):
> # tar -tzvf foo.tar.gz
>
Chad Kellerman wrote:
>
>I was wondering if there is a one liner that searches a file for a
> string and then removes that line and the following four lines in the
> file?
grep 'string' -A 4 yourfile.txt | grep -v -f - yourfile.txt
:-)
John
--
use Perl;
program
fulfillment
--
To unsubs
On Wednesday, October 9, 2002, at 07:08 AM, Jenda Krynicky wrote:
> Yeah ... "Browser Client" applications tend to take longer to do
> anything in.
Of course, this can be as much a fault of bad interface design as the
medium.
> The interface cannot contain all the features and rings
> and bel
I am trying to create a graph showing que length in relation to time. My
problem is that the script below does not put the time in the x-axis, it
just puts 5,10,15,20 etc. I think the problem is with the x axis commands.
I've changed the x_tick_number to auto and null, but the actual values
Jerry Preston wrote:
>
> Hi!
Hello,
> I do not understand why my regex works , then does not.
>
> regex:
> my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
> Works!
>
> Process Name = D4_jerry_5LM_1.91_BF
> Returns:
>Process Name DM4 15C035 5LM
>
> Does NOT work:
>Process Nam
On 9 Oct 2002, chad kellerman wrote:
> Perl gurus,
>
>I was wondering if there is a one liner that searches a file for a
> string and then removes that line and the following four lines in the
> file?
Any particular reason for a one-liner?
perl -i~ -pe '((/string/and$ln=$.)..($.-$ln==4))&&u
On Wednesday, October 9, 2002, at 05:28 AM, NYIMI Jose (BMB) wrote:
> Do you have some reasons in which case "Distributed GUI" will be the
> winner against "Browser Client" ?
Sure, tons. Neither Photoshop nor Warcraft III are going to see a HTML
interface in their next revision. Don't get m
Adriano Allora wrote:
>
> Hi to all,
Hello,
> I feel myself very stupid, but I've tried to do it in different ways
> and I cannot do it.
> I need to clear a text, to tokenize it, for instance to delete some
> things and to transform some others:
> .. at this time I use this regexp:
> a) to dele
On Oct 9, Nikola Janceski said:
>perl -e 'printf "%.0d\n", $ARGV[0]/2 if @ARGV' 5
>
>Weird why doesn't this work they way I expect it to?
>it returns 2 not 3.
Blame C and the IEEE standards.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734
Can someone show me an example of how I can mix long and short options with
Getopt?
I would like to pass options to a perl script that can take both short and
long options. For example, all of these commands work (this is GNU tar):
# tar -tzvf foo.tar.gz
# tar --list zvf foo.tar.gz
# tar
$x++ if $x%2;
This increments $x if $x is odd.
Shawn
robert.zielfelder@tycoelect
From: "Zielfelder, Robert"
<[EMAIL PROTECTED]>
> I am trying to write a script that at one point needs to look at a
> number and divide it by two. The results must always be an integer,
> but the numerator can potentially be an odd number. What I want to do
> is if the numerat
From: "NYIMI Jose (BMB)" <[EMAIL PROTECTED]>
> > The Browser's interface cannot contain all the features and rings
> > and bells a normal GUI can (unless you use Java and use the browser
> > just to download and host the application)
>
> What about Perl for the aforementioned functionality.
> It's
perl -e 'printf "%.0d\n", $ARGV[0]/2 if @ARGV' 5
Weird why doesn't this work they way I expect it to?
it returns 2 not 3.
> -Original Message-
> From: Zielfelder, Robert
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 10:58 AM
> To: Perl Beginners List (E-mail)
> Subje
Jerry Preston wrote:
> Is there a way to make this regex smart enough to handle both string? Is
> there a way that (\w+)_ can be changed to 2 to 10?
>
> my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
Use the split function instead.
Greetings,
Janek
--
To unsubscribe, e-mail: [EMAIL P
Robert Zielfelder wrote:
> I am trying to write a script that at one point needs to look at a number
> and divide it by two. The results must always be an integer, but the
> numerator can potentially be an odd number.
So you just want to divide by 2 rounding up the result.
use POSIX qw/ceil
Hi,
$num += $num % 2;
this increments $num if $num modulo 2 is 1
(ie. if $num was odd)
regards.
"Zielfelder, Robert" a écrit :
>
> Greetings,
>
> I am trying to write a script that at one point needs to look at a number
> and divide it by two. The results must always be an integer, but the
Greetings,
I am trying to write a script that at one point needs to look at a number
and divide it by two. The results must always be an integer, but the
numerator can potentially be an odd number. What I want to do is if the
numerator is odd, increment it to the next highest even number. Is t
> ...
> regex:
>
> my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
>
>
> Works!
>
> Process Name = D4_jerry_5LM_1.91_BF
>
> Returns:
>
>Process Name DM4 15C035 5LM
>
> Does NOT work:
>
>Process Name = d4_jerry_5lm
> ...
Hi, is that 3rd _ intended ? If yes, it would work on "Proce
> The Browser's interface cannot contain all the features and rings
> and bells a normal GUI can (unless you use Java and use the browser
> just to download and host the application)
What about Perl for the aforementioned functionality.
It's seems that Java is the Guru in GUI matters ? :(
José
OK!
I see 2 as to 3.
Is there a way to make this regex smart enough to handle both string? Is
there a way that (\w+)_ can be changed to 2 to 10?
my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
Thanks,
Jerry
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sen
Jerry Preston wrote:
> Hi!
>
> I do not understand why my regex works , then does not.
>
> regex:
>
> my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
^
This last underscore is expected.
>
> Works!
>
> Process Name = D4_jerry_5LM
See inline comments
> -Original Message-
> From: Jerry Preston [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 10:36 AM
> To: Beginners Perl
> Subject: regex is working , then not?
>
>
> Hi!
>
> I do not understand why my regex works , then does not.
>
> regex:
>
> my
Perl gurus,
I was wondering if there is a one liner that searches a file for a
string and then removes that line and the following four lines in the
file?
Thanks,
Chad
--
Chad Kellerman
Jr. Systems Administrator
Alabanza Inc
410-234-3305
signature.asc
Description: This is a digitally si
Hi!
I do not understand why my regex works , then does not.
regex:
my (@dat) = /(\w+\s+\w+\s+)=\s+(\w+)_(\w+)_(\w+)_/;
Works!
Process Name = D4_jerry_5LM_1.91_BF
Returns:
Process Name DM4 15C035 5LM
Does NOT work:
Process Name = d4_jerry_5lm
Is there a better way to write t
Adriano Allora wrote:
> b) to transform
> s/-+/-/g;
> s/\*+/\*/g;
> s/\^+/\^/g;
> s/\_+/\_/g;
> s/ +/ /g; (this one doesn't works very well: at the end there are
> several blank spaces)
>
> and I used this one: s/\s+/ /g; but I understand this is not very
> useful: I need to change a multiple
Hi,
I've downloaded Tie::File module from
http://search.cpan.org/author/MJD/Tie-File-0.93/
and given it a little try : works fine.
(even for me : Just Another Perl Newbie).
Thanks, José.
"NYIMI Jose (BMB)" a écrit :
>
> Why not just use Tie::File module ?
>
> http://search.cpan.org/author/JHI
Hi, pravesh
1 - You are saying "mv <
> HI
> I define a file the following way:
>
> $FILE_HANDLE = "<
> then I openit
>
> open(FILEHANDLE);
>
> i perform some operations..
>
> and then I want to transfer this "somefile" to some other directory
>
> but I am not able to use mv comand to do i
HI
I define a file the following way:
$FILE_HANDLE = "<
Hi to all,
I feel myself very stupid, but I've tried to do it in different ways
and I cannot do it.
I need to clear a text, to tokenize it, for instance to delete some
things and to transform some others:
.. at this time I use this regexp:
a) to delete
s/=+\n//g;
s/-+\n//g;
b) to transform
s/-+
From: "NYIMI Jose (BMB)" <[EMAIL PROTECTED]>
> > my 2 cents...
> >
> > Distributed GUI apps are legacy. Write web based software.
>
> You right !
> That's what I was thinking about ...
>
> Do you have some reasons in which case "Distributed GUI" will be the
> winner against "Browser Client" ?
From: Jim Ockers <[EMAIL PROTECTED]>
> Is there any concise method of fully evaluating the arithmetic
> expressions in here documents, rather than just one level of
> substitution?:
>
> sub RotationMatrix {
> my $theta = $_[0] * 3.14159265 / 180.0;
> my $m = cos($theta);
> my $n = sin
Due to an bad and old software i need to do an fix.
i have problems though, i need to list all the users in a global group. (Active
directory), this was easy to do. I need to put these users in an local group on a
server, this is easy aswell!
The problem i get is that when i list the global
Thanks Jean,
But I am afraid to say that my log file is
at least over 60 K lines. I do not know how to do it.
How can I insert any words in any place of open text
file?
Regards
Winn
--- Jean Padilla <[EMAIL PROTECTED]>
wrote:
> Not an expert in perl (nor in english), but let's
> try ;-)
On Wed, 9 Oct 2002 09:00:20 +0100, [EMAIL PROTECTED] (Mat Harris)
wrote:
>
>I tried
>
> require './config.cgi';
>
>I still get the same error. Any other idea's. This one really has me
>stumped.
Your config.cgi needs to have a
1;
on it's last line.
Also check permissions on the file.
--
To unsu
Why not just use Tie::File module ?
http://search.cpan.org/author/JHI/perl-5.8.0/lib/Tie/File.pm#SYNOPSIS
José.
> -Original Message-
> From: Hello Buddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: I need help for handling t
> my 2 cents...
>
> Distributed GUI apps are legacy. Write web based software.
You right !
That's what I was thinking about ...
Do you have some reasons in which case "Distributed GUI" will be the winner against
"Browser Client" ?
Should I continue learning Perl/Tk then ? :-)
José.
D
Not an expert in perl (nor in english), but let's try ;-)
if your output file is not supposed to get too big,
consider 'writing' first your output lines in a hash
... $hash{1} = "line 1"; and so on
(later, writing line 10 for eg.)
if (whatever)
{
$hash{5} .= " these few words";
}
when finished,
Hi Perl experts,
I need your help. I am absolute Perl beginner.
I am writing perl with Windows 95 machine. I download
Perl from activestate and my version 5.6.1. It works
properly and I can run some program.
Currently I am writing log file processing with
perl. I can write normal pro
Jessee Parker wrote:
>Is there a way to keep track of the number of open sockets your program might have
>that are in a TIME_WAIT (I think it is) state?
>
>
>
If you want can trye this script for to track the socket open on the
ports feel free for every change that you want to do.
thio script
- Forwarded message from Bootscat <[EMAIL PROTECTED]> -
From: "Bootscat" <[EMAIL PROTECTED]>
To: "Mat Harris" <[EMAIL PROTECTED]>
Subject: Re: FW: Need urgent help
Date: Tue, 8 Oct 2002 20:04:38 -0500
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.00
82 matches
Mail list logo