On Fri, Nov 13, 2009 at 5:07 AM, Parag Kalra wrote:
> Hey All,
>
> I have a following a LDIF file to process through Perl -
>
> ###
> dn: ou=71404558, ou=Company, ou=Personal, o=paragkalra.com
> dn: ou=People, ou=71404558, ou=Company, ou
On Fri, Nov 13, 2009 at 5:07 AM, Parag Kalra wrote:
> Hey All,
>
> I have a following a LDIF file to process through Perl -
>
> ###
> dn: ou=71404558, ou=Company, ou=Personal, o=paragkalra.com
> dn: ou=People, ou=71404558, ou=Company, ou
a)
> open (BHF_FILE, ") {
#do something with $line
}
close $BHF_FILE;
b) Take a look at this code:
use strict;
use warnings;
use 5.010;
my $line = 'hello world goodbye';
my @pieces = split / /, $line, 2;
for (@pieces) {
say;
}
--output:--
hello
world goodbye
At the command line,
On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote:
> Why are you replying to me? My post did use the three-argument form of
> open(). Also:
>
> - It is bad form to use upper case letters for lexical variables
>
"Perl Best Practices" disagrees with you.
> - Passing / / as the first parameter of
above: $@";
}
--output:--
executing other code here
There was an error inside that eval block above: ***prepare error*** at
2perl.pl line 7.
On Mon, Feb 1, 2010 at 1:40 PM, Tony Esposito
wrote:
> Is this the idea? I do not ever want to catch the error from the prepare
> statement itsel
>
I thought you said the program fails if you don't catch the error? If so,
and you want your program to continue executing, then you have to catch
On 2/4/10, Chris wrote:
> On Feb 4, 10:59 am, shlo...@iglu.org.il (Shlomi Fish) wrote:
>> Hi Chris!
>>
>> Have you visitedhttp://perl-begin.org/yet and read a good introductory
>> book
>> or tutorial?
>>
>> On Thursday 04 Feb 2010 09:27:32 Chris wrote:
>>
>> > I need some help with this problem.
>
ontains 30 values that were
>>> written previously, and this has been verified over and over.
>>>
>>> sub newValues {
>>> my($file) = shift;
>>>
>>> open(FILE, "<$file") or die("Unable to open data file.");
>
On 2/8/10, Chris Coggins wrote:
> What is the proper syntax for a comparison at the end of a subroutine to
> stop the script if a certain variable is "0" or ''?
>
> sub routine{
> (get data and process it)
> if $varA = '' || $varA = "0" {
> (stop script, print error message to user)
> }
> else{
>
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, Chris Coggins wrote:
>> What is the proper syntax for a comparison at the end of a subroutine to
>> stop the script if a certain variable is "0" or ''?
>>
>> sub routine{
>&g
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
>> On 2/8/10, Chris Coggins wrote:
>>> What is the proper syntax for a comparison at the end of a subroutine to
>>> stop the script if a certain variable is "0&qu
On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
> >>>>> "7" == 7 <7stud.7s...@gmail.com> writes:
>
> 7> if (defined $var && ($var eq '' || $var eq '0')) {
>
> 7> #code
>
> 7> }
>
> 7&
On Mon, Feb 8, 2010 at 9:00 PM, 7 <7stud.7s...@gmail.com> wrote:
> On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
>
>> >>>>> "7" == 7 <7stud.7s...@gmail.com> writes:
>>
>> 7> if (defined $var && ($var eq ''
On Mon, Feb 8, 2010 at 6:45 PM, Chris Coggins wrote:
> Thanks Jim. I used
>
> exit(0) unless $varA;
>
That form of unless is especially poor style.
On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote:
> >>>>> "7" == 7 <7stud.7s...@gmail.com> writes:
>
they both read fine in english which is why they we included by
> larry.
They don't both read fine. To many people, unless is a confusing
15 matches
Mail list logo