On 12/09/2011 20:47, Ryan Munson wrote:
The full exercise states:
Write a program that asks for a decimal number less than 256 and converts
it to binary. (Hint: You may want to use the bitwise and operator 8 times.)
Since 256 is 2^8, I am assuming using a computation of 2**8 is involved.
You
On 9/12/11 Mon Sep 12, 2011 12:47 PM, "Ryan Munson"
scribbled:
> The full exercise states:
>
> Write a program that asks for a decimal number less than 256 and converts
> it to binary. (Hint: You may want to use the bitwise and operator 8 times.)
>
> Since 256 is 2^8, I am assuming using a co
On Mon, Sep 12, 2011 at 3:47 PM, Ryan Munson
wrote:
> it to binary. (Hint: You may want to use the bitwise and operator 8 times.)
>
> Since 256 is 2^8, I am assuming using a computation of 2**8 is involved.
The answer is in the hint. What does the bitwise-and operator give
you? See perldoc perlop
The full exercise states:
Write a program that asks for a decimal number less than 256 and converts
it to binary. (Hint: You may want to use the bitwise and operator 8 times.)
Since 256 is 2^8, I am assuming using a computation of 2**8 is involved.
Ryan
On 9/12/11 3:29 PM, "Brandon McCaig"
On Mon, Sep 12, 2011 at 2:55 PM, Ryan Munson
wrote:
> I am running through a good book on Perl and am having some issues with a
> script I am trying to create for one of the practice exercises (I am
> teaching myself Perl for work). Just to let you know the solution does not
> involve using an if
I could, but the book also mentions a hint to using the bitwise operator.
Loops are still to come. =)
Ryan
From: Hal Wigoda
Date: Mon, 12 Sep 2011 14:07:18 -0500
To: Ryan Munson
Subject: Re: need some help with writing a basic program
Use a while or for loop
On Sep 12, 2011 1:58 PM
Hi all,
I am running through a good book on Perl and am having some issues with a
script I am trying to create for one of the practice exercises (I am
teaching myself Perl for work). Just to let you know the solution does not
involve using an if statement because this is in the next chapter.
The
solaristar wrote:
First please forgive me if this is the wrong way to go about asking
this question.
I already answered this question on comp.lang.perl.misc. Do you want me
to answer it again here?
John
--
The programmer is fighting against the two most
destructive forces in the universe:
First please forgive me if this is the wrong way to go about asking
this question.
I have a script im working on that is looking to only get the
filenames with ".mw.|.cw.|.uw." and exclude any filenames (which
happen to be FQDNs of servers) that do not have that criteria
the structure to search i
Amit Saxena wrote:
On Mon, Jul 21, 2008 at 2:11 AM, Rob Dixon <[EMAIL PROTECTED]> wrote:
If you were using the <=> operator to compare non-numeric strings
you would get a warning, but any scalar value is a valid string so
you will get no warnings if you compare numeric values with the cmp
oper
On Mon, Jul 21, 2008 at 2:11 AM, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> Tobias Eichner wrote:
> >
> > I'm currently dealing with a sample program I try to understand. Here it
> is:
> >
> > ---
> >
> > #!/usr/bin/perl
> >
> > use strict; use warnings; use diagnostics;
> >
> > # Array to sort
> >
@rob: Thank you for your hints :-)
__
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://lear
Tobias Eichner wrote:
>
> I'm currently dealing with a sample program I try to understand. Here it is:
>
> ---
>
> #!/usr/bin/perl
>
> use strict; use warnings; use diagnostics;
>
> # Array to sort
> my @unsortiert = qw(Z A z a 19 91);
>
> # Print array to sort
> print "@unsortiert"; print "
I'm currently dealing with a sample program I try to understand. Here it is:
---
#!/usr/bin/perl
use strict; use warnings; use diagnostics;
# Array to sort
my @unsortiert = qw(Z A z a 19 91);
# Print array to sort
print "@unsortiert"; print "\n";
# Print positions of unsorted array (0 to last
On Thu, May 29, 2008 at 12:02 AM, Vasant Kumar <[EMAIL PROTECTED]> wrote:
>
> $VAR1 = { B => { C => [ {1}, {2}. {3} ]}
>
> Now accessing B is no problem, but I want to access the values in C..
Hello,
$VAR1->{B}->{C}->[0];
will get the first element of the anonymous array whose KEY is C.
--
Jef
Hi,
I'm using PERL for the first time, and I need to parse an XML
Document.
Essentially we have a file that's structures like this
now when I do something like
$data = XMLin($XML, forcearray => ["C"]);
It has something similar to
$VAR1 = { B => { C => [ {1}, {2}. {3} ]}
Now accessin
> ""FamiLink" == "FamiLink Admin" <[EMAIL PROTECTED]> writes:
"FamiLink> I am trying to verify a credit card number format with the
following: (below)
"FamiLink> but I am getting errors like:
Why not just use Business::CreditCard?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc
On 4/27/07, FamiLink Admin <[EMAIL PROTECTED]> wrote:
I am trying to verify a credit card number format with the following:
(below) but I am getting errors like:
Global symbol "%r" requires explicit package name at ./modmember.cgi line
681.
This is because, under 'use strict', you must declar
I am trying to verify a credit card number format with the following:
(below) but I am getting errors like:
Global symbol "%r" requires explicit package name at ./modmember.cgi line
681.
Global symbol "%r" requires explicit package name at ./modmember.cgi line
683.
Global symbol "%r" requires
> I need to find every ocuring "... blok in a text,
> even If this ocurs multiple times on 1 line.
If you're doing HTML it's worth looking HTML::TokeParser for a quick and
easy and generally reliable means of extracting the contents of the
'bold' element: great POD, too -- this is a slightly
I need to find every ocuring "... blok in a text, even If
this ocurs multiple times on 1 line.
example text:
Inclus: eau, \303\251lectricit\303\251 et chauffage.
responce should be:
Inclus:
chauffage.
I tryed some things with perl or shell:
echo 'Inclus: eau, \303\251lectricit\303\251 et
Mike Blezien wrote:
: My regrex is not very strong and need to some help figuring
: out the best way to do this.
I don't use regular expressions to parse HTML. I generally
use HTML::TokeParser. The documentation is pretty good and I
can step through the markup the same way I read it.
HTH,
Hello,
We need to grab some data from a webpage fetch via the LWP module. This is the
coding and
the $resultdata below, need to regrex out various data, indicated by the [ ]
brackets... see below for further explainations.
My regrex is not very strong and need to some help figuring out the best
Daniel Gladstone wrote:
I thought this would be easy but I can not get it to work - can someone
please help me:
Problem: I have a file of 7.5 million records that are pipe delimted,
the first field is a record
number. I want to search for around 10 records with a specific record
number and if
Daniel Gladstone wrote:
I thought this would be easy but I can not get it to work - can someone
please help me:
Problem: I have a file of 7.5 million records that are pipe delimted,
the first field is a record
number. I want to search for around 10 records with a specific record
number and
I thought this would be easy but I can not get it to work - can someone
please help me:
Problem: I have a file of 7.5 million records that are pipe delimted, the
first field is a record
number. I want to search for around 10 records with a specific record number
and if they
meet that condition
>
> > -Original Message-
> > From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 16, 2004 9:03 AM
> > To: Ron Goral; Perl Beginners; [EMAIL PROTECTED]
> > Subject: Re: Need some help using lib to add custom directories to @IN
> -Original Message-
> From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 16, 2004 9:03 AM
> To: Ron Goral; Perl Beginners; [EMAIL PROTECTED]
> Subject: Re: Need some help using lib to add custom directories to @INC
>
>
> Please only po
Please only post to one group, if that group does not yield a good
answer, then try a different one. Especially since this has nothing to
do with CGI.
> Can anyone tell me why this code fails when trying to load
> Some_Module_In_lib_Dir-
> ==
> my $file_path =
> substr
Can anyone tell me why this code fails when trying to load
Some_Module_In_lib_Dir-
==
my $file_path =
substr($ENV{SCRIPT_FILENAME},0,index($ENV{SCRIPT_FILENAME},'/test.cgi'));
use lib "$file_path/../lib";
use Some_Module_In_lib_Dir;
==
And th
You,re right! But I had some hours, so my solution is :
-
#!/usr/bin/perl
$file = "$ARGV[0]";
open(HANDLE, '<' , "$file");
@lines=;
foreach $line (@lines)
{
@test=split("#include",$line);
print $test[0] ;
@plik=split("#include <",$line);
@plik1=split(">",$plik[1])
Could you please make it clear what you want to do (unless I'm missing
the point) when you say you want to change the #include lines to their
entry.
Do you meant you want to put the data from the file in instead of the
#include line?
>>> Mariusz Wyrozebski <[EMAIL PROTECTED]> 07/01/02 03:29pm >>
I'm very curious about little script, that works as "prep" in c/c++.
The problem is:
We have one file, which contains lines like
-
#include
#include
blah,blah,blah
-
in blah you have nomal c program.
Everything I want is to change li
I'm having major difficulties installing a module on OS X. I've
followed the minimal instructions on
http://developer.apple.com/internet/macosx/perl.html
but am getting numerous errors. Since I am a beginner at this I was
wondering if someone could follow through my process and see if I'm
mis
On Sat, 5 Jan 2002, McCollum, Frank wrote:
> Does anyone know where to get help if you destroy a computer while
> installing Linux...?
> HELP would be greatly (I mean greatly) appreciated. Please excuse the
> non-perl question, but I know we got some Linux users here and I am
> desparate now
rt [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 06, 2002 5:38 AM
To: [EMAIL PROTECTED]
Subject: Re: not perl, but need some help with Linux...
Frank McCollum wrote:
> Does anyone know where to get help if you destroy a computer while
> installing Linux...?
>
> Problem (of cour
-Message d'origine-
De : maximilian sichart <[EMAIL PROTECTED]>
À : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : dimanche 6 janvier 2002 11:44
Objet : Re: not perl, but need some help with Linux...
>Frank McCollum wrote:
>
>> Does anyone know where to get h
Frank McCollum wrote:
> Does anyone know where to get help if you destroy a computer while
> installing Linux...?
>
> Problem (of course this comes up after formatting c: drive and using a boot
> disk)
> 1. Linux autoboot.bat program detects windows running and will not install
> (of course wind
Does anyone know where to get help if you destroy a computer while
installing Linux...?
Problem (of course this comes up after formatting c: drive and using a boot
disk)
1. Linux autoboot.bat program detects windows running and will not install
(of course windows is not running, though)
2. Window
Hi!
I need some direction writing a perl script and would
apprecitiate
any help I could get.
Okay, this is what I need to do...
I've a text file that has kept a log of information.
Here is some
actual data from the file.
--
- - - - - - - - - - - - - - - - - - - - Frame 1 - - -
- - - -
Hey perl,
Monday, July 02, 2001, 5:21:16 AM, my MUA believes you used
(X-Mailer not set) to write:
pdo> hi,
pdo> I want to do this :
pdo> i have some servers where i want to check if some files exists and the user
pdo> must put the all path with the name of the file ...
pdo> use strict;
pdo
hi,
I want to do this :
i have some servers where i want to check if some files exists and the user
must put the all path with the name of the file ...
use strict;
#that's the file where my servers are ...
open (LISTESERVEUR, "c:\\perl\\presence\\listeserveur.txt") || die "Ne peut
ouvrir l
At 11:43 25.06.2001 +0200, [EMAIL PROTECTED] wrote:
>En réponse à Aaron Craig <[EMAIL PROTECTED]>:
>
> > foreach my $fichier (@fichiers)
> > {
> > my $result = (-e $fichier)? "$fichier fait (stat $fichier)[7]
> > octets\n" :
> > "$fichier inexistant \n";
> >
En réponse à Aaron Craig <[EMAIL PROTECTED]>:
> I would do something like this:
>
> use strict; # very important, and saves a lot of headache!
>
> open (SERV, "c:\\perl\\bin\\liste.txt") || die "Could not open
> liste.txt:
> $!"; # added error checking
> my @serveurs = ;
> close (SERV);
> open
I would do something like this:
use strict; # very important, and saves a lot of headache!
open (SERV, "c:\\perl\\bin\\liste.txt") || die "Could not open liste.txt:
$!"; # added error checking
my @serveurs = ;
close (SERV);
open (RESULT, ">>c:\\resultat.txt") || die "Could not open resultat.txt
well, first of all you want to take this open statement out of the 'for loop' and
declare it before the loop starts:
$resultat="c:\\resultat.txt";
open (RESULT, ">>$resultat");
not sure why the file existance check isn't working.. you might want to add some
print statements, or maybe try and open
I want to do this :
I have a file where there are 256 servers names, one server name per line.
I want to read all lines to take the names of all servers to check the size of
some files ...
I tried this but it's not working like I want .. :
$serveur="c:\\perl\\bin\\liste.txt";
open (SERV, "$ser
Andrew Teo ([EMAIL PROTECTED]) wrote:
> Just curious, how would you send an attachment?
Get MIME::Lite from CPAN.
--
If we fail, we will lose the war.
Michael Lamertz | [EMAIL PROTECTED] / [EMAIL PROTECTED]
Nordstr. 49 | http://www.lamertz.net
507
Hi,
You may find the MacOSX list helpful. Here's the article announcing the list.
http://use.perl.org/article.pl?sid=01/03/29/1452216&mode=thread&threshold=
send a message to subscribe at [EMAIL PROTECTED]
At 05:32 AM 5/1/2001 -0400, you wrote:
>Hey guys,
>
>Thanks so much for your help. The s
Hey guys,
Thanks so much for your help. The supplied code was excellent. You Perl
people are alright! :-)
In answer to Johnathan Kupferer's question at to my computing platform, I'm
actually working on a Mac g4 running Mac OS X and am very interested in
testing out its Perl programming capabi
Honestly, I've never had to. I would use Mail::Mailer except I don't
see it with ActiveState's ppm. Its possible with Mail::Sendmail,
looking at the source I see the note:
Look at http://alma.ch/perl/Mail-Sendmail-FAQ.htm for additional info
(CGI, examples of sending attachments, HTML mai
: Just curious, how would you send an attachment?
The MIME::Lite module can do this.
-- tdk
Just curious, how would you send an attachment?
Johnathan Kupferer wrote:
>
> Aww... you should have let him hire a consultant. ;o)
>
> Seriously though, this is dead simple. Gary's code is great and robust
> if a bit intimidating for a newbie. You said you have background in
> VisualBasic
Aww... you should have let him hire a consultant. ;o)
Seriously though, this is dead simple. Gary's code is great and robust
if a bit intimidating for a newbie. You said you have background in
VisualBasic and that would lead me to think you might be using windoze
NT or 2000. (Unfortunately
--- Curtis Michelson <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm a Perl newbie for sure. I recently subscribed to the list and
> this is my first post.
Welcome aboard. =o)
> . . .
> I'd like to try using Perl for a current client project. Situation
> is this:
> Web users need to hit an HTML fo
Hi Curtis,
this script is far from nice, but it works. A lot of it you could
probably remove. The recipientlist enabled me to hide the email
addresses inside the cgi.
To improve it try looking at CPAN for mail handling routines.
Gary
__BEGIN__
#!/usr/bin/perl
#
# My varient of formmail.
#
Hi,
I'm a Perl newbie for sure. I recently subscribed to the list and this is
my first post.
My programming background is limited C and VisualBasic stuff. My regular
focus is database development and I work a lot with Filemaker Pro. I also
do some web devpt. as well.
I'd like to try using Pe
57 matches
Mail list logo