Run Perl Scripts from iPod.

Discussion in 'iPod touch' started by eLMafUDd, Nov 23, 2007.

  1. eLMafUDd

    eLMafUDd New Member

    Joined:
    Sep 15, 2007
    Messages:
    1
    Likes Received:
    0
    Hey, I have a jailbroken ipod touch with custom applications installed.

    I was just wondering if it was possible to run perl scripts from the iPod Touch.

    Specifically, one to change the display message on a HP printer:

    Code:
    #!/usr/bin/perl
    
    # $Id: hpsetdisp.pl 11 2006-03-22 01:21:03Z yaakov $
    
    # hpsetdisp.pl
    # Connects to a JetDirect equipped HP printer and uses
    # HP's control language to set the ready message on the
    # LCD display. Takes an IP address and message on STDIN.
    # My favorite message is "INSERT COIN". Keep in mind the
    # limitations of the display when composing your clever
    # verbiage.
    #
    # THIS PROGRAM IS PROVIDED WITH NO WARRANTY OF ANY KIND EXPRESSED OR IMPLIED
    # THE AUTHOR CANNOT BE RESPONSIBLE FOR THE EFFECTS OF THIS PROGRAM
    # IF YOU ARE UNCERTAIN ABOUT THE ADVISABILITY OF USING IT, DO NOT!
    #
    # Yaakov (http://kovaya.com/)
    
    use strict;
    use warnings;
    
    unless (@ARGV) { print "usage: $0 ""n" ; exit }
    if ($ARGV[3]) { print "Did you forget the quotes around your clever message?n" }
    
    my $peeraddr = $ARGV[0];
    my $rdymsg = $ARGV[1];
    chomp $peeraddr;
    
    use IO::Socket;
    my $socket = IO::Socket::INET->new(
    PeerAddr => $peeraddr,
    PeerPort => "9100",
    Proto => "tcp",
    Type => SOCK_STREAM
    ) or die "Could not create socket: $!";
    
    my $data = <<EOJ
    \e%-12345X\@PJL JOB
    \@PJL RDYMSG DISPLAY="$rdymsg"
    \@PJL EOJ
    \e%-12345X
    EOJ
    ;
    
    print $socket $data;
    
    I have the Perl Runtime enviroment and terminal vt100 installed.

    Do I just save this script somewhere and run it?

    If so, where?

    Thanks.

Share This Page