Perl
Home
Perl SQL
Services
Links
Resume
Games
Star Wars
Star Trek
Wheel of Time
Code
  • $something =~ s/\|\|/<br>/g;
  • $username =~ tr/A-Z/a-z/;
  • $cryptpassword = crypt($password,$password);#encrypt the password for writting to .htpasswd
    # add user to .htpasswd
    open(HTPASSWD,">>/usr/local/etc/httpd/cgi-bin/est2/pages/.htpasswd") || die "could not open .htpasswd";
    printf HTPASSWD "$username:$cryptpassword\n";
    close(HTPASSWD);
  • #if $tmp contains $num then print $tmp
    if($tmp =~ m/$num/)
    {
    print "$tmp";
    }
  • $results = 'dir';
  • $return_code = system('dir');