#!/usr/bin/perl use strict; # ** comments = things to discuss # **putting configurable data in # variables at the top my $title = $ARGV[0]; my $outputfile = 'SETME'; my $host = 'SETME'; my $user = 'SETME'; my $pass = 'SETME'; my $path = 'SETME'; my $ftpcommand = "/usr/bin/ncftpput -u $user -p $pass $host $path $outputfile"; # ** > and < for "open" calls # ** string interpolation with "" vs '' # ** what is a "filehandle"? open OUTFILE, ">$outputfile"; # ** 'while' syntax; # ** < > operators, # ** true and false values in Perl # including 'undef' $title =~ s/_/ /g; $title =~ s/^[0-9]+-//g; print OUTFILE $title; close OUTFILE; my $error = system($ftpcommand); die "ftp command failed" if $error;