Re: Perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott,

The issue is that you have sent about a dozen messages, which show little effort on your part to try and figure out these basic problems. Quite frankly, if you are unable to do these, which you say is a screening portion of an interview, that how do you expect to show any compentance within the realm if you get past that part. For a large part (and I don't speak for the entire list) everyone is willing to pitch in, if we can see that a reasonable effort has been shown, or if someone has a non-trivial problem. I still stand by what I said earlier, you are trying to get us to do your work for you. The web has a wealth of introductory material for all sorts of stuff. Get your feet wet. If you can't afford a book, go to the library, or search the web for reference material.

This list is an admin list, not a learn to program bash or perl group. It isn't that we don't want to help. But help yourself first. You won't get a job if you don't know basic fundamentals.

That said, for printing odd numbers 1-10. you can do it either of a few ways. One is simply to start at one and increment by 2 which will give you odd numbers all the way. Or if you want to be different, increment by one, and use % operator to find numbers that aren't divisible by 2.

#!/usr/bin/perl
for ($i=1; $i < 10 ; $i++)
{
  if ($i%2 !=0)
{
    print "$i\n";
}
}

for ($i=1 ; $i < 10 ; $i+=2)
{
   print "$i\n";
}

Good luck on the job hunt.


On Wed, 31 Mar 2004 22:54:22 -0800, Scott@Charter <scott.smallsreed@xxxxxxxxxxx> wrote:


Then why do these groups exist? Did you ever stop and think that maybe I am
in a rush? Did you ever stop and think that maybe I am unemployed, looking
for a job, and can't afford a book? Did you ever stop and think that there
are kind, intelligent people out there who are willing and happy to just
answer questions politely that are asked politely? I guess we can't all
have your flare for life!


Go spread your cheer in the grumpy user group. (and I'm being nice) There
are nice people out there who are willing to help me out. Some people just
want/need a little help with certain things. Why did you become a member of
this group?


Besides, I have a useless Perl book.


----- Original Message ----- From: "tyler" <tyler@xxxxxxxxxxxxxxxxxxx> To: "Scott@Charter" <scott.smallsreed@xxxxxxxxxxx> Cc: "Linux-Admin-Group" <linux-admin@xxxxxxxxxxxxxxx> Sent: Wednesday, March 31, 2004 9:29 PM Subject: Re: Perl



www.google.com/linux


and then a search for perl... or books! did you know they have books with
just this sort of thing in them! save your eyes, read a book my friend.


On Wed, 31 Mar 2004, Scott@Charter wrote:

> Can anyone please help me with a short example Perl script that will
print
> out all the odd numbers between 1 and 10? I don't know Perl and am
trying
> to learn it.  I wrote a bash script to do the same thing and wanted to
> compare it.
>
> There must be a Perl expert out there somewhere who can help me?
>
> Thanks-
> Scott
>

- : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html



-- | Richard Nairn Specializing in Linux | Nairn Consulting Web / Database Solutions | Calgary, AB | Richard@xxxxxxxxxxxxxxxxxx - : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux