Programming Languages C Subjective
Mar 15, 2013

IF you want to concatenate strings with Perl. How would you do that?

Detailed Explanation

By using the dot operator which concatenates strings in Perl.
Eg. $string = “My name is”.$name

 

Situation: You want to download the contents of a URL with Perl. How would you do that?

 

- Use use the libwww-perl library, LWP.pm
- #!/usr/bin/perl
use LWP::Simple;
$url = get 'http://www.DevDaily.com/';

 

Situation: You want to connect to SQL Server through Perl. How would you do that?

 

Perl supports access to all of the major database systems through a number of extensions
provided through the DBI toolkit, a third-party module available from CPAN. Under Windows you can use either the DBI interfaces or the Win32::ODBC toolkit, which provides direct access to any ODBC-compliant database including SQL Server database products.
Using DBI:
use DBI;
my $dbh = DBI->connect(DSN);
Using ODBC:
Use Win32::ODBC;
$database = new Win32::ODBC("DSN" [, CONNECT_OPTION, ...]);

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback