Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: need help urgent using @ARGV

by ww (Bishop)
on Jan 19, 2012 at 03:57 UTC ( #948669=note: print w/replies, xml ) Need Help??

in reply to need help urgent using @ARGV

Please clarify the narrative portion of your SOPW -- which may be achieved, in some part, by using conventional grammar, syntax and punctuation (AKA "complete sentences with capitalization and punctuation").

Aside: it appears that what you tell us up to the words "suppose my code is in is irrelevant to the question you didn't ask but that, on a WAG, may be, "how do I revise this code to use..." perl -i servername -d databasename

Of course, the code you show offers very little support for (or "relevance to") my WAG, so maybe you'd better clarify your thinking... and then your question.

And, for the benefit of others with better brains, less time or patience, here's what your (posted) code is apparently supposed to look like:

use strict; use Win32::SqlServer qw(SCALAR); print "Please enter DB name:\n"; my $name = <STDIN>; chomp($name); # Log in to server . my $sqlsrv = Win32::SqlServer::sql_init('localhost', 'geff', 'gentle', + 'Northwind'); # Our SQL statement. my $stmnt = <<SQLEND; BACKUP database "$name" TO DISK = N'c:\\bak\\master.dmp' SQLEND # Run query. my $result = $sqlsrv->sql($stmnt, SCALAR); # Print results. foreach my $name (@$result) { print "$name\n"; }

Update, clarifying: That is, that's what the code would have looked like if you'd bothered reading the advice about formatting in Writeup Formatting Tips. That is NOT to say it's anything even close to good code.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948669]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-01-19 17:29 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.