#!/usr/bin/perl use strict; use warnings; use IO::Handle; open( COM, "/dev/ttyUSB0") || die "Cannot read serial port : $!\n"; while( ){ # do stuff here }