On Monday 25 Apr 2011, Shlomi Fish wrote:
> On Sunday 24 Apr 2011 21:01:57 Shawn H Corey wrote:
> > On 11-04-24 10:36 AM, Akhthar Parvez K wrote:
[ snip ]
> > I still think I have to disagree. Sometimes interviewers ask purposely
> > obscure questions not to see if you know
On Sunday 24 Apr 2011, Shawn H Corey wrote:
> On 11-04-24 09:48 AM, Akhthar Parvez K wrote:
> > #5 - Never give a wrong answer - If at all you receive a question that you
> > don't know, do not panic, just be smart and divert the question so you can
> > answer what y
ould let you handle the interview in the best possible way.
#5 - Never give a wrong answer - If at all you receive a question that you
don't know, do not panic, just be smart and divert the question so you can
answer what you know.
#6 - Please your interviewer with well explained respon
;
> # print "Found\n";
> }
> }
> }
>
>
#read MSRT first
@msrt = ;
chomp(@msrt);
#perform the check while reading Test_server
while ($tom = )
{
chomp($tom);
my @result = grep { /\Q$tom\E/ } @msrt;
print "$tom: @result\n" if @result;
}
#T
ust the following simple regex would do, right?
/.*(E)/
or did I miss another important criteria? If so, please excuse me for I'm
probably not concentrating enough now. Might be because it's being late night
over here. Good nite/day!
--
Regards,
Akhthar Parvez K
http://www.sysad
red in perl4.
> it shouldn't be used in perl5 calls unless you know why and it is a very
> special case.
Thanks for clarifying that.
--
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to
understand
signatures.
>
> like i just did to the whole email you quoted.
>
Well, I hope that was an aberration as I usually do bottom postings only.
Apologize for any inconvenience brought to you.
--
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a simple oper
outine
I remember I'd read in the past that & should be used in such cases so that
Perl can easily recognize I'm attempting to call a subroutine, correct and/or
is that (only) required with older versions?
--
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a
Hi Henning,
$catch = $1 if ($string =~ /.*(E)\d*\b/);
you can use this to test it:
$catch = $1 if ($string =~ /.*(E\d*)\b/);
--
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity
> -stevieb
>
> ps: % perl -e 'print "Not Another Perl Hacker"'
>
>
>subject: A story
.. and a good one at that :-)
--
Regards,
Akhthar Parvez K
http://tips.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to
understand t
they were
two separate regex expressions. Sorry for that!
my $rx1 = qr{ ab(cd) }mx;
my $rx2 = qr{ (pq)rs }mx;
So could you tell me how would you write the statement now?
--
Regards,
Akhthar Parvez K
http://tips.sysadminguide.com/
UNIX is basically a simple operating system, but you have to b
On Saturday 22 May 2010, Jim Gibson wrote:
> On 5/21/10 Fri May 21, 2010 12:13 PM, "Akhthar Parvez K"
> scribbled:
> > Shouldn't
> > Perl be smart enough to understand that the outer most pair of paranthesis
> > and
> > | symbol were solely used f
nwanted delay if there are more strings to be matched, so
I thought to get it done in a single statement, or a group of statements,
without any loop. The above regex method worked for me, except it gave me some
undefs as well. Is there any way I can get rid of them by using the same
statement
On Friday 21 May 2010, Akhthar Parvez K wrote:
> Look at this code:
>
> my @data = ( 'Twinkle twinkle little star
> How I wonder what you are
> Up above the world so high
> Like a diamond in the sky.
> 123
> Twinkle twinkle little star
> How I wonder what you are
like it was not picked because some part of the string was
already picked by another regex. How can I get the expression pick that as well
so the output would be like below:
result: $VAR1 = [
'little starHow I wonder',
'what you areUp above the world'
grep show only the matched string like Unix egrep -o or Perl regex?
--
Regards,
Akhthar Parvez K
http://tips.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennis Ritchie
--
To unsubscribe, e-mail: beginners-uns
On Thursday 13 May 2010, Akhthar Parvez K wrote:
> On Thursday 13 May 2010, Shlomi Fish wrote:
> > Then it is very likely that the memory allocated to the "mem" pointer will
> > not
> > be returned to the kernel due to the nature of malloc() and how it is
am is forking
that part of the program so that it will run as a child process and return all
the memory used by it back to the system. Please correct me if I am wrong.
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to b
l won't need to grow its size if it can
> reuse lexical data that is reclaimed upon scope exit.
>
Doesn't Perl free up any memory that was used by it until the program exits? If
that's how it goes, if a Perl program uses a lot of memory at the beginning and
it takes
y that's used to allocate a
variable defined with 'my' will be freed up once the current lexical scope is
exited?
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicit
"vvw" => "\%vvw_dirs" );
Remove the quotes. When you put something around quotes, you're telling it's a
string and a reference is not a string as you know.
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
31" => "dir32", "dir33" => "dir34" );
# PKV
my %pkv_dirs=( "dir41" => "dir42", "dir43" => "dir44" );
# VVW
my %vvw_dirs=( "dir51" => "dir52", "dir53" => "dir54" );
#
is
not the argument list of another subroutine inside that.
>>print N(@_#HERE)
Why are you calling the subroutine N? Have you already defined a subroutine
with the name N in your program?
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, b
ays if everything is OK
(you may do occassionally), but if anything failed :-)
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: b
e explanation John. Could you give one or two real time examples
where you used a list (instead of an array) except in loops such as: for ('a',
'b', 'c', 'd')? I wonder if I'm underusing lists in my Perl programs.
--
Regards,
Akhthar Parvez K
htt
as RAID, it's important to have a live monitoring
system such as nagios so that you'll never miss out on such things. At the end
of day, it comes down to how you manage what you have got in your hands.
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simpl
- But what if
the file is huge?
2. Opening filehandles again and again - would cause I/O overhead
3. any other method?
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
statement, loop is processed whilst the file is being
read and hence it's more appropriate. So while would be a better choice, more
so if the file size is higher and there's a scope of closing the file before
it's read completely.
That's what I understood. Please correct
production code - it's a very bad
> idea.).
Thanks Shlomi for the explanation. I was amazed with some of the Perl tricks,
so wondering if it can go to that extent to blow me out completely.
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating sy
ehandle and the
scalar variable. Is Perl too intelligent to recognize both of them?
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-un
program here, I
think he should state clearly what he wants to do as it will help both parties
(those who seek help and those who help) and eventually the resolution would be
faster.
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but
0];
Nice to see all these explanations coming in. Thanks Charles :-)
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
r functions inside it.
Correct and thanks for clearing my misconception! Is there any way to catch
only the second return value then? I am not so sure but I think I had done it
in the past using the method that I mentioned earlier (or similar).
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.
On Thursday 29 Apr 2010, Shlomi Fish wrote:
> On Thursday 29 Apr 2010 14:39:11 Akhthar Parvez K wrote:
> > There was a typo in my original email. I missed the word "not" which was
> > very crucial as always.
> >
> > Scenario: #1
> > unless ( (define
quot; a few
years back, but haven't been into scripting except Shell for the past few years
and may be due to that, lost on that completely. But with you guys' help, I
have polished it back now. :-)
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple ope
at)
Anything wrong with this method? If so, what's the correct method then?
--
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Thursday 29 Apr 2010, Shawn H Corey wrote:
> !( A && B ) === !A || !B
Thanks Shawn, had learnt it a few years back, but forgot that it seems and
eventually got confused :-)
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you
ESS $test does
not contain TEST), but not the scenario #1.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
On Thursday 29 Apr 2010, Akhthar Parvez K wrote:
> Hi,
well for me,
but I'm getting the following warning:
Scalar value @_[0] better written as $_[0]
I hate warnings, but how can I fix that? As I said, $_[0] doesn't work. Can
someone shed some light on this?
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simp
SS $test does
contain TEST), but not the scenario #1.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For addi
for the next one which produces the errors mentioned, only a few lines
> later!
So you have fixed those lines as well, good :) Btw, the messages you received
were "warnings", not errors I guess.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple
($fred != $href->{fred})
{
print "fred failed.\n";
}
}
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubsc
ne 232.
>
> Could somebody please tell me why this doesn't work?
Most probably you have used an undefined scalar in an expression. Would be good
if you can mention the lines along with the line no.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating
reference as an argument while calling the function. Do remember
that you can't pass the hash to a function, but just the hash reference. Also
minimize (or even avoid) the use of declaring with "our", use argument passing
instead.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUI
t; tried this below, but it doesn't match correctly.
if ($string =~ /^[\w\s]*$/) {print "$string\n";}
else {print "Invalid Keyword. Please check and try again\n";}
Audio A4 Quattro -> Audio A4 Quattro
Tom & Jerry -> Invalid Keyword. Please check and try aga
uninitialized value in concatenation (.) or string at
scripts/test/test2.pl line 14.
extracted:
But it worked for the OP (the above condition may not have been required for
him) and that's what is important :-)
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a sim
Hi,
> It works fine and I like it. My regex is not that good, but I can see what
> is doing. I modified it a bit (to capture up till a full stop sign).
Kewl. Good to hear that!
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you h
Hi Shawn,
> $str =~ m{ \A ( .{15} .*? ) \s }msx;
I don't think this would work if the value given in the match string (15 as per
above eg.) is greater than the character count of the particular string. Right?
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically
ints:
The black cat climbed the green tree
My knowledge in Perl is limited, so there may be a more apt solution in your
case.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Ric
Got that, thanks Shlomi! However, can this be done by referencing $1 directly
with strict refs on? I definitely feel it can be done and would be nice to know
how!
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
while "strict refs" in use at test.pl
I tried to overcome this issue using scalar(), but didn't help. Could someone
please let me know what is the workaround here. Thank you!
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, b
an alternative that would work in my case as well.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
On Thursday 08 Apr 2010, Rob Coops wrote:
> On Thu, Apr 8, 2010
help me to set this up?
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginner
Excellent, John. Didn't know that Perl only deals with decimal numbers. Funny
thing was I did think that it could be a hex, so converted it to binary and
done an AND, but didn't get the desired result. Wonder why I didn't give a
thought that it could be decimal!
Regards,
Akhtha
e given directory is having 1777 perm
mode?
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
55 matches
Mail list logo