<?xml version="1.0" encoding="windows-1252"?>
<node id="600255" title="Re: Okay I have cleaned it up a little bit" created="2007-02-15 12:47:27" updated="2007-02-15 07:47:27">
<type id="11">
note</type>
<author id="409850">
blazar</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;I have taken your computer feedback to heart and cleaned up my code a little bit - I think this a lot more perl like and pretty technical.&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;Indeed this &lt;em&gt;does&lt;/em&gt; look more like [doc://perl|Perl], but code must not be &lt;em&gt;"perl like"&lt;/em&gt;, it must have valid Perl [doc://perlsyn|syntax]... well, if you want it to be valid Perl, and the program to work, that is. Also, it doesn't seem "pretty technical". It seems pretty basic, errors apart.&lt;/p&gt;

&lt;blockquote&gt;&lt;i&gt;&lt;c&gt;
#!/usr/bin/perl -w

use strict;
&lt;/c&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;It's &lt;em&gt;very very&lt;/em&gt; good that you're under [mod://strict|strictures] and [mod://warnings], but with recent enough perls it's better (i.e. more flexible) to&lt;/p&gt;

&lt;c&gt;
use warnings;  # rather than -w
&lt;/c&gt;

&lt;blockquote&gt;&lt;i&gt;&lt;c&gt;
system "netbackup/bin/admincmd/bpdbjobs -report -all_columns\n";
&lt;/c&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;You don't need that &lt;c&gt;\n&lt;/c&gt;. Nay, I would have thought it to issue an error, but I checked and that's not the case. Whatever, it's still confusing at best. Also, it's better to use the multiple args form of [doc://system].&lt;/p&gt;

&lt;blockquote&gt;&lt;i&gt;&lt;c&gt;
mail "xxxxxx@xxxxx.com
&lt;/c&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;There's no &lt;c&gt;mail()&lt;/c&gt; Perl [doc://perlfunc|builtin]:&lt;/p&gt;

&lt;c&gt;
campari:~ [18:37:59]$ perldoc -f mail
No documentation for perl function `mail' found
&lt;/c&gt;

&lt;p&gt;See? And even if there were, you have an incomplete statement. The above should read:&lt;/p&gt;

&lt;c&gt;
mail "xxxxxx\@xxxxx.com";
&lt;/c&gt;

&lt;p&gt;Notice that I quoted the &lt;c&gt;@&lt;/c&gt; sign, for otherwise perl would interpret that as if you wanted to interpolate the &lt;c&gt;@xxxxx&lt;/c&gt; array into your string, because yes: double quoted strings interpolate (scalars and arrays). Else, you would use a single quoted string, like thus:&lt;/p&gt;

&lt;c&gt;
mail 'xxxxxx@xxxxx.com';
&lt;/c&gt;

&lt;blockquote&gt;&lt;i&gt;but still I get:
&lt;c&gt;
Bareword "com" not allowed while "strict subs" in use at ./nb.pl line 7.&lt;br&gt;
Unquoted string "com" may clash with future reserved word at ./nb.pl line 7.&lt;br&gt;
Execution of ./nb.pl aborted due to compilation errors.
&lt;br&gt;&lt;/c&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;I don't trust you! &lt;em&gt;That cannot be your actual program&lt;/em&gt;. When I run &lt;c&gt;perl -c&lt;/c&gt; on it I get&lt;/p&gt;

&lt;c&gt;
String found where operator expected at foo2.pl line 7, at end of line
        (Missing semicolon on previous line?)
Can't find string terminator '"' anywhere before EOF at foo2.pl line 7.
&lt;/c&gt;

&lt;p&gt;instead, which makes much more sense as an error message.&lt;/p&gt;

&lt;p&gt;BTW: what's with those &lt;c&gt;&lt;br&gt;&lt;/c&gt;'s anyway?&lt;/p&gt;</field>
<field name="root_node">
600223</field>
<field name="parent_node">
600223</field>
</data>
</node>
